using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using Atlas;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using HarmonyLib;
using Sodalite.Api;
using Sodalite.Utilities;
using UnityEditor;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.UI;
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace MeatKit
{
public class HideInNormalInspectorAttribute : PropertyAttribute
{
}
}
namespace Predaaator.PCG
{
[BepInPlugin("Predaaator.PCG", "PCG", "1.0.2")]
[BepInProcess("h3vr.exe")]
[Description("Built with MeatKit")]
[BepInDependency("nrgill28.Atlas", "1.0.1")]
public class PCGPlugin : BaseUnityPlugin
{
private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
internal static ManualLogSource Logger;
private void Awake()
{
Logger = ((BaseUnityPlugin)this).Logger;
LoadAssets();
}
private void LoadAssets()
{
Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "Predaaator.PCG");
AtlasPlugin.RegisterScene(Path.Combine(BasePath, "prueba"));
}
}
}
namespace localpcnerd.OnslaughtMode
{
public class OnslaughtManager : MonoBehaviour
{
[Header("Config panels")]
public GameObject Sosig_Panel;
[Header("Sosig Settings")]
public Spawner[] sosigSpawners_Guard;
public Spawner[] sosigSpawners_Assault;
public float Max_Range_Sp;
[Header("procedural enemy spawn limits")]
public Transform Center_;
public Transform Checker_;
public Transform Area_01;
public Transform Area_02;
public Transform Building_01;
public Transform Building_02;
public Transform Defense_01;
public Transform Defense_02;
public Transform Marksman_01;
public Transform Marksman_02;
[Header("Game Settings")]
public Transform[] teleportPoint_e;
public Transform[] teleportPoint_ou;
public Transform[] teleportPoint_t1;
public Transform[] teleportPoint_t2;
public Transform[] teleportPoint_t3;
public Transform[] teleportPoint_b1;
public Transform[] teleportPoint_b2;
public Transform endgamePoint;
[Header("UI")]
public Text sosigMode;
public Text customMode;
public Text sosigAmount;
public Text sosigWave;
public Text sosigChase;
public Text sosigChaseR;
public Text sosigType;
public Text sosigLevel;
public Text sosigRate;
public Text sosigWander;
public Text sosigSpawn;
public Text sosigSfpmin;
public Text sosigSfpmax;
public Text sosigSwpmin;
public Text sosigSwpmax;
public Text sosigClean;
public Text sosigFSref;
public Text playerSpawn;
public Text playerArmor;
public Text Winnings;
public Text Losses;
public Text Gameplay;
public Text Enemies;
[Header("Arena billboards")]
public Text[] timerTexts;
public Text[] EnRemText;
public Text summaryText;
public Text Lastrecord;
public Text killsText;
[HideInInspector]
public List<SosigMarker> spawnedSosigs = new List<SosigMarker>();
[HideInInspector]
public int eRate;
[HideInInspector]
public int randomsS;
[HideInInspector]
public int eWander;
private float Men_Del = 0.25f;
private string ene_lab;
private int mMod;
private int mAmo;
private int mWav;
private int mCha;
private int mChaR;
private int mTyp;
private int mLvl;
private int mRat;
private int mWan;
private int mSpa;
private int mSfpmin;
private int mSfpmax;
private int mSwpmin;
private int mSwpmax;
private int mCle;
private int mFsr;
private float mTim;
private string dLabel;
private int dAmo;
private int dWav;
private int dCha;
private int dChaR;
private int dTyp;
private int dLvl;
private int dRat;
private int dWan;
private int dSpa;
private int dSfpmin;
private int dSfpmax;
private int dSwpmin;
private int dSwpmax;
private int dCle;
private int dFsr;
private float dTim;
private int mAmo_;
private int mWav_;
private int mCha_;
private int mChaR_;
private int mTyp_;
private int mLvl_;
private int mSfpmin_;
private int mSfpmax_;
private int mSwpmin_;
private int mSwpmax_;
private int mCle_;
private int mFsr_;
private float mTim_;
private int Win_;
private int Los_;
private float Gam_;
private int Ene_;
private int mpSp;
private int mpHe;
private int dpSp;
private int dpHe;
private int mpSp_;
private int spawncount;
private int kills;
private int spawnamount;
private bool Spawnmonitor;
private bool FirstES;
private Transform[] teleportPoint;
private Spawner sosigSpawners;
private string Lastrecord_;
private float Vector_X1;
private float Vector_Y1;
private float Vector_Z1;
private float Vector_X2;
private float Vector_Y2;
private float Vector_Z2;
private bool runtimer = false;
private float elapsed;
private TimeSpan timePlaying;
private void Awake()
{
runtimer = false;
Spawnmonitor = false;
FirstES = true;
Show_panels(act: false);
SetMode(PlayerPrefs.GetInt("Mode", 0));
}
private void Update()
{
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Invalid comparison between Unknown and I4
//IL_0195: Unknown result type (might be due to invalid IL or missing references)
//IL_019a: Unknown result type (might be due to invalid IL or missing references)
//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: Unknown result type (might be due to invalid IL or missing references)
//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
//IL_01be: Unknown result type (might be due to invalid IL or missing references)
//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
//IL_0208: Unknown result type (might be due to invalid IL or missing references)
//IL_023b: Unknown result type (might be due to invalid IL or missing references)
//IL_0249: Unknown result type (might be due to invalid IL or missing references)
if (!runtimer)
{
return;
}
foreach (SosigMarker spawnedSosig in spawnedSosigs)
{
if ((int)spawnedSosig.sosig.BodyState == 3)
{
if (mCle_ == 1)
{
spawnedSosig.sosig.ClearSosig();
}
spawnedSosigs.Remove(spawnedSosig);
kills++;
}
}
Text[] enRemText = EnRemText;
foreach (Text val in enRemText)
{
int num = spawnamount - kills;
val.text = dLabel + " " + ene_lab + " remaining: " + num;
}
bool flag = false;
switch (mCha_)
{
case 1:
flag = spawnamount - kills <= 3;
break;
case 2:
flag = true;
if (spawnamount - kills <= 3)
{
mChaR_ = 0;
}
break;
}
if (flag)
{
foreach (SosigMarker spawnedSosig2 in spawnedSosigs)
{
Vector3 position = ((Component)GM.CurrentPlayerBody).transform.position;
Vector3 position2 = ((Component)spawnedSosig2.sosig).transform.position;
float num2 = Vector3.Distance(position2, position);
Vector3 dominantGuardDirection = position - position2;
float num3 = Max_Range_Sp * ((float)mChaR_ / 100f);
if (num2 > num3)
{
spawnedSosig2.sosig.UpdateAssaultPoint(position);
spawnedSosig2.sosig.UpdateGuardPoint(position);
spawnedSosig2.sosig.SetDominantGuardDirection(dominantGuardDirection);
continue;
}
float num4 = Random.Range(0f, num3 + 1f);
if (num2 < num4)
{
spawnedSosig2.sosig.UpdateAssaultPoint(position2);
spawnedSosig2.sosig.UpdateGuardPoint(position2);
}
}
}
if ((double)spawnedSosigs.Count <= (double)mAmo_ * 0.4 && Spawnmonitor)
{
Spawnmonitor = false;
((MonoBehaviour)this).StartCoroutine(Callspawns(0.02f));
}
if (kills >= spawnamount)
{
EndGame();
((MonoBehaviour)this).StartCoroutine(Exito(2f));
}
if (GM.CurrentPlayerBody.Health <= 0f)
{
EndGame();
GM.CurrentSceneSettings.DeathResetPoint = ((Component)endgamePoint).transform;
summaryText.text = "* You lose *";
Lastrecord.text = "-- Last record: " + Lastrecord_ + " --";
killsText.text = dLabel + " " + ene_lab + ": " + kills;
PlayerPrefs.SetInt("Losses_" + mMod, ++Los_);
PlayerPrefs.SetFloat("Gameplay_" + mMod, Gam_ += (float)timePlaying.TotalSeconds);
PlayerPrefs.SetInt("Enemies_" + mMod, Ene_ += kills);
}
}
private void startTimer()
{
runtimer = true;
((MonoBehaviour)this).StartCoroutine(RunTimer());
}
private IEnumerator RunTimer()
{
while (runtimer)
{
elapsed += Time.deltaTime;
timePlaying = TimeSpan.FromSeconds(elapsed);
string tps = timePlaying.Hours.ToString("00") + ":" + timePlaying.Minutes.ToString("00") + ":" + timePlaying.Seconds.ToString("00");
Text[] array = timerTexts;
foreach (Text val in array)
{
val.text = "Time: " + tps.ToString();
}
yield return null;
}
}
public void StartGame()
{
Mode_save();
Player_spawn();
spawnamount = mWav_ * mAmo_;
Spawnmonitor = true;
startTimer();
}
public void Player_spawn()
{
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
switch (mpSp_)
{
case 0:
teleportPoint = teleportPoint_e;
break;
case 1:
teleportPoint = teleportPoint_ou;
break;
case 2:
teleportPoint = teleportPoint_b1;
break;
case 3:
teleportPoint = teleportPoint_b2;
break;
case 4:
teleportPoint = teleportPoint_t1;
break;
case 5:
teleportPoint = teleportPoint_t2;
break;
case 6:
teleportPoint = teleportPoint_t3;
break;
}
int num = Random.Range(0, teleportPoint.Length);
GM.CurrentMovementManager.TeleportToPoint(teleportPoint[num].position, true, teleportPoint[num].forward);
}
private void EndGame()
{
runtimer = false;
foreach (SosigMarker spawnedSosig in spawnedSosigs)
{
spawnedSosig.sosig.ClearSosig();
}
}
private void Titulo_menu()
{
sosigMode.text = "Mode:\n" + dLabel + " " + PlayerPrefs.GetString("State_" + mMod, "") + "\n" + ene_lab + ": " + mAmo * mWav;
if (mTim > 0f)
{
TimeSpan timeSpan = TimeSpan.FromSeconds(mTim);
Lastrecord_ = timeSpan.Hours.ToString("00") + ":" + timeSpan.Minutes.ToString("00") + ":" + timeSpan.Seconds.ToString("00");
sosigMode.text = sosigMode.text + " / Record: " + Lastrecord_;
}
else
{
Lastrecord_ = "00:00:00";
}
customMode.text = "Config " + dLabel.ToString();
}
private void Show_panels(bool act)
{
Sosig_Panel.SetActive(act);
}
private void Mode_save()
{
PlayerPrefs.SetInt("Mode", mMod);
}
public void Save_custom()
{
PlayerPrefs.SetString("State_" + mMod, "(Fixed)");
PlayerPrefs.SetInt("Amount_" + mMod, mAmo);
PlayerPrefs.SetInt("Waves_" + mMod, mWav);
PlayerPrefs.SetInt("Chase_" + mMod, mCha);
PlayerPrefs.SetInt("ChaseR_" + mMod, mChaR);
PlayerPrefs.SetInt("Type_" + mMod, mTyp);
PlayerPrefs.SetInt("Level_" + mMod, mLvl);
PlayerPrefs.SetInt("Rate_" + mMod, mRat);
PlayerPrefs.SetInt("Wander_" + mMod, mWan);
PlayerPrefs.SetInt("Spawn_" + mMod, mSpa);
PlayerPrefs.SetInt("Spawnmin_" + mMod, mSfpmin);
PlayerPrefs.SetInt("Spawnmax_" + mMod, mSfpmax);
PlayerPrefs.SetInt("Spawnwmin_" + mMod, mSwpmin);
PlayerPrefs.SetInt("Spawnwmax_" + mMod, mSwpmax);
PlayerPrefs.SetInt("Clean_" + mMod, mCle);
PlayerPrefs.SetInt("FSRef_" + mMod, mFsr);
PlayerPrefs.SetInt("pSpawn_" + mMod, mpSp);
PlayerPrefs.SetInt("pHealth_" + mMod, mpHe);
PlayerPrefs.DeleteKey("Time_" + mMod);
PlayerPrefs.DeleteKey("Winnnings_" + mMod);
PlayerPrefs.DeleteKey("Losses_" + mMod);
PlayerPrefs.DeleteKey("Gameplay_" + mMod);
PlayerPrefs.DeleteKey("Enemies_" + mMod);
SetMode(mMod);
}
private IEnumerator Load_custom(float t)
{
yield return (object)new WaitForSeconds(t);
SetAmount(PlayerPrefs.GetInt("Amount_" + mMod, dAmo));
SetWaves(PlayerPrefs.GetInt("Waves_" + mMod, dWav));
SetChase(PlayerPrefs.GetInt("Chase_" + mMod, dCha));
SetChaseR(PlayerPrefs.GetInt("ChaseR_" + mMod, dChaR));
SetType(PlayerPrefs.GetInt("Type_" + mMod, dTyp));
SetLevel(PlayerPrefs.GetInt("Level_" + mMod, dLvl));
SetRate(PlayerPrefs.GetInt("Rate_" + mMod, dRat));
SetWander(PlayerPrefs.GetInt("Wander_" + mMod, dWan));
SetSpawn(PlayerPrefs.GetInt("Spawn_" + mMod, dSpa));
SetSfpmin(PlayerPrefs.GetInt("Spawnmin_" + mMod, dSfpmin));
SetSfpmax(PlayerPrefs.GetInt("Spawnmax_" + mMod, dSfpmax));
SetSwpmin(PlayerPrefs.GetInt("Spawnwmin_" + mMod, dSwpmin));
SetSwpmax(PlayerPrefs.GetInt("Spawnwmax_" + mMod, dSwpmax));
SetClean(PlayerPrefs.GetInt("Clean_" + mMod, dCle));
SetFSRef(PlayerPrefs.GetInt("FSRef_" + mMod, dFsr));
SetpSpawn(PlayerPrefs.GetInt("pSpawn_" + mMod, dpSp));
SetHealth(PlayerPrefs.GetInt("pHealth_" + mMod, dpHe));
mTim = PlayerPrefs.GetFloat("Time_" + mMod, 0f);
Win_ = PlayerPrefs.GetInt("Winnnings_" + mMod, 0);
Los_ = PlayerPrefs.GetInt("Losses_" + mMod, 0);
Gam_ = PlayerPrefs.GetFloat("Gameplay_" + mMod, 0f);
Ene_ = PlayerPrefs.GetInt("Enemies_" + mMod, 0);
Winnings.text = "Winnings: " + Win_;
Losses.text = "Losses: " + Los_;
TimeSpan show_time_score = TimeSpan.FromSeconds(Gam_);
Gameplay.text = "Gameplay: " + show_time_score.Hours.ToString("00") + ":" + show_time_score.Minutes.ToString("00") + ":" + show_time_score.Seconds.ToString("00");
Enemies.text = ene_lab + ": " + Ene_;
Titulo_menu();
Update_lvl_vars();
}
public void SetMode(int mod)
{
switch (mod)
{
case 0:
dLabel = "'Training'";
ene_lab = "Targets";
dAmo = 50;
dWav = 2;
dCha = 1;
dChaR = 0;
dTyp = 15;
dLvl = 1;
dRat = 50;
dWan = 100;
dSpa = 0;
dCle = 1;
dFsr = 1;
dSfpmin = 3;
dSfpmax = 60;
dSwpmin = 15;
dSwpmax = 100;
dpSp = 0;
dpHe = 100;
break;
case 1:
dLabel = "'CQB'";
ene_lab = "Enemies";
dAmo = 20;
dWav = 1;
dCha = 0;
dChaR = 0;
dTyp = 0;
dLvl = 3;
dRat = 80;
dWan = 100;
dSpa = 1;
dCle = 0;
dFsr = 0;
dSfpmin = 0;
dSfpmax = 10;
dSwpmin = 3;
dSwpmax = 100;
dpSp = 3;
dpHe = 500;
break;
case 2:
dLabel = "'MRB'";
ene_lab = "Enemies";
dAmo = 20;
dWav = 1;
dCha = 1;
dChaR = 0;
dTyp = 0;
dLvl = 3;
dRat = 80;
dWan = 100;
dSpa = 0;
dCle = 0;
dFsr = 1;
dSfpmin = 3;
dSfpmax = 15;
dSwpmin = 15;
dSwpmax = 100;
dpSp = 2;
dpHe = 500;
break;
case 3:
dLabel = "'Assault'";
ene_lab = "Enemies";
dAmo = 25;
dWav = 1;
dCha = 1;
dChaR = 0;
dTyp = 0;
dLvl = 4;
dRat = 80;
dWan = 100;
dSpa = 0;
dCle = 0;
dFsr = 0;
dSfpmin = 0;
dSfpmax = 10;
dSwpmin = 15;
dSwpmax = 100;
dpSp = 4;
dpHe = 1000;
break;
case 4:
dLabel = "'Defense'";
ene_lab = "Enemies";
dAmo = 8;
dWav = 3;
dCha = 2;
dChaR = 3;
dTyp = 0;
dLvl = 4;
dRat = 0;
dWan = 0;
dSpa = 2;
dCle = 1;
dFsr = 1;
dSfpmin = 15;
dSfpmax = 100;
dSwpmin = 15;
dSwpmax = 100;
dpSp = 0;
dpHe = 2000;
break;
case 5:
dLabel = "'Marksman'";
ene_lab = "Enemies";
dAmo = 20;
dWav = 1;
dCha = 1;
dChaR = 0;
dTyp = 0;
dLvl = 4;
dRat = 80;
dWan = 100;
dSpa = 3;
dCle = 0;
dFsr = 1;
dSfpmin = 60;
dSfpmax = 70;
dSwpmin = 15;
dSwpmax = 100;
dpSp = 6;
dpHe = 100;
break;
case 6:
dLabel = "'Zombies'";
ene_lab = "Rotwieners";
dAmo = 30;
dWav = 2;
dCha = 1;
dChaR = 0;
dTyp = 5;
dLvl = 2;
dRat = 50;
dWan = 100;
dSpa = 0;
dCle = 1;
dFsr = 1;
dSfpmin = 3;
dSfpmax = 60;
dSwpmin = 15;
dSwpmax = 100;
dpSp = 0;
dpHe = 1000;
break;
case 7:
dLabel = "'Assassin'";
ene_lab = "Warriors";
dAmo = 10;
dWav = 1;
dCha = 1;
dChaR = 0;
dTyp = 10;
dLvl = 3;
dRat = 50;
dWan = 100;
dSpa = 0;
dCle = 0;
dFsr = 0;
dSfpmin = 0;
dSfpmax = 10;
dSwpmin = 15;
dSwpmax = 100;
dpSp = 4;
dpHe = 100;
break;
}
mMod = mod;
((MonoBehaviour)this).StartCoroutine(Load_custom(Men_Del));
}
public void SetAmount(int amo)
{
sosigAmount.text = "Amount:\n" + amo;
mAmo = amo;
}
public void SetWaves(int wav)
{
sosigWave.text = "Waves:\n" + wav;
mWav = wav;
}
public void SetChase(int cha)
{
switch (cha)
{
case 0:
sosigChase.text = "Chase\nthe player\n(n/a on wanders):\nNever";
break;
case 1:
sosigChase.text = "Chase\nthe player\n(n/a on wanders):\n3 sosigs remaining";
break;
case 2:
sosigChase.text = "Chase\nthe player\n(n/a on wanders):\nAlways";
break;
default:
sosigChase.text = "Chase\nthe player\n(n/a on wanders):\nNever";
break;
}
mCha = cha;
}
public void SetChaseR(int chara)
{
sosigChaseR.text = "Chase radius\nfrom player:\n" + chara;
mChaR = chara;
}
public void SetType(int typ)
{
switch (typ)
{
case 0:
sosigType.text = "Type:\nS-Ops";
break;
case 5:
sosigType.text = "Type:\nRotwiener";
break;
case 10:
sosigType.text = "Type:\nGladiator";
break;
case 15:
sosigType.text = "Type:\nElf";
break;
}
mTyp = typ;
}
public void SetLevel(int lvl)
{
sosigLevel.text = "Level:\n" + lvl;
mLvl = lvl;
}
public void SetRate(int rat)
{
sosigRate.text = "Defenders %:\n" + rat;
mRat = rat;
}
public void SetWander(int wnd)
{
sosigWander.text = "Assaulters\nwander %:\n" + wnd;
mWan = wnd;
}
public void SetSpawn(int spw)
{
switch (spw)
{
case 0:
sosigSpawn.text = "Spawn:\nEverywhere";
break;
case 1:
sosigSpawn.text = "Spawn:\nBuilding";
break;
case 2:
sosigSpawn.text = "Spawn:\nSurface";
break;
case 3:
sosigSpawn.text = "Spawn:\nUp there";
break;
}
mSpa = spw;
}
public void SetSfpmin(int sfpmin)
{
sosigSfpmin.text = "Min radius from\nreference to wave:\n" + sfpmin;
mSfpmin = sfpmin;
}
public void SetSfpmax(int sfpmax)
{
sosigSfpmax.text = "Max radius from\nreference to wave:\n" + sfpmax;
mSfpmax = sfpmax;
}
public void SetSwpmin(int swpmin)
{
sosigSwpmin.text = "Min radius from\nplayer to next wave:\n" + swpmin;
mSwpmin = swpmin;
}
public void SetSwpmax(int swpmax)
{
sosigSwpmax.text = "Max radius from\nplayer to next wave:\n" + swpmax;
mSwpmax = swpmax;
}
public void SetClean(int cle)
{
switch (cle)
{
case 1:
sosigClean.text = "Clean sosigs\ncorpses:\nYes";
break;
case 0:
sosigClean.text = "Clean sosigs\ncorpses:\nNo";
break;
}
mCle = cle;
}
public void SetFSRef(int fsr)
{
switch (fsr)
{
case 0:
sosigFSref.text = "First wave\nreference:\nMap center";
break;
case 1:
sosigFSref.text = "First wave\nreference:\nPlayer";
break;
}
mFsr = fsr;
}
public void SetpSpawn(int pspw)
{
switch (pspw)
{
case 0:
playerSpawn.text = "Spawn:\nEverywhere";
break;
case 1:
playerSpawn.text = "Spawn:\nOutside";
break;
case 2:
playerSpawn.text = "Spawn:\nBuilding in";
break;
case 3:
playerSpawn.text = "Spawn:\nBuilding out";
break;
case 4:
playerSpawn.text = "Spawn:\nClose towers";
break;
case 5:
playerSpawn.text = "Spawn:\nFar towers";
break;
case 6:
playerSpawn.text = "Spawn:\nMarksman";
break;
}
mpSp = pspw;
}
public void SetHealth(int hp)
{
switch (hp)
{
case 100:
playerArmor.text = "Armor:\nNone";
break;
case 500:
playerArmor.text = "Armor:\nLight";
break;
case 1000:
playerArmor.text = "Armor:\nMedium";
break;
case 2000:
playerArmor.text = "Armor:\nHeavy";
break;
case 100000:
playerArmor.text = "Armor:\nTank";
break;
}
mpHe = hp;
}
public void SetDeleteSaveSelected()
{
PlayerPrefs.DeleteKey("State_" + mMod);
PlayerPrefs.DeleteKey("Amount_" + mMod);
PlayerPrefs.DeleteKey("Waves_" + mMod);
PlayerPrefs.DeleteKey("Chase_" + mMod);
PlayerPrefs.DeleteKey("ChaseR_" + mMod);
PlayerPrefs.DeleteKey("Type_" + mMod);
PlayerPrefs.DeleteKey("Level_" + mMod);
PlayerPrefs.DeleteKey("Rate_" + mMod);
PlayerPrefs.DeleteKey("Wander_" + mMod);
PlayerPrefs.DeleteKey("Spawn_" + mMod);
PlayerPrefs.DeleteKey("Spawnmin_" + mMod);
PlayerPrefs.DeleteKey("Spawnmax_" + mMod);
PlayerPrefs.DeleteKey("Spawnwmin_" + mMod);
PlayerPrefs.DeleteKey("Spawnwmax_" + mMod);
PlayerPrefs.DeleteKey("Clean_" + mMod);
PlayerPrefs.DeleteKey("FSRef_" + mMod);
PlayerPrefs.DeleteKey("pSpawn_" + mMod);
PlayerPrefs.DeleteKey("pHealth_" + mMod);
PlayerPrefs.DeleteKey("Time_" + mMod);
PlayerPrefs.DeleteKey("Winnnings_" + mMod);
PlayerPrefs.DeleteKey("Losses_" + mMod);
PlayerPrefs.DeleteKey("Gameplay_" + mMod);
PlayerPrefs.DeleteKey("Enemies_" + mMod);
SetMode(mMod);
}
public void SetDeleteStatisticSelected()
{
PlayerPrefs.DeleteKey("Winnnings_" + mMod);
PlayerPrefs.DeleteKey("Losses_" + mMod);
PlayerPrefs.DeleteKey("Gameplay_" + mMod);
PlayerPrefs.DeleteKey("Enemies_" + mMod);
SetMode(mMod);
}
public void SetDeleteSave()
{
PlayerPrefs.DeleteAll();
SetMode(0);
}
public void Update_lvl_vars()
{
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_010f: Unknown result type (might be due to invalid IL or missing references)
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_012e: Unknown result type (might be due to invalid IL or missing references)
//IL_0133: Unknown result type (might be due to invalid IL or missing references)
//IL_0152: Unknown result type (might be due to invalid IL or missing references)
//IL_0157: Unknown result type (might be due to invalid IL or missing references)
//IL_0171: Unknown result type (might be due to invalid IL or missing references)
//IL_0176: Unknown result type (might be due to invalid IL or missing references)
//IL_0190: Unknown result type (might be due to invalid IL or missing references)
//IL_0195: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: Unknown result type (might be due to invalid IL or missing references)
//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
//IL_0211: Unknown result type (might be due to invalid IL or missing references)
//IL_0216: Unknown result type (might be due to invalid IL or missing references)
//IL_0230: Unknown result type (might be due to invalid IL or missing references)
//IL_0235: Unknown result type (might be due to invalid IL or missing references)
//IL_024f: Unknown result type (might be due to invalid IL or missing references)
//IL_0254: Unknown result type (might be due to invalid IL or missing references)
//IL_026e: Unknown result type (might be due to invalid IL or missing references)
//IL_0273: Unknown result type (might be due to invalid IL or missing references)
//IL_028d: Unknown result type (might be due to invalid IL or missing references)
//IL_0292: Unknown result type (might be due to invalid IL or missing references)
//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
//IL_030e: Unknown result type (might be due to invalid IL or missing references)
//IL_0313: Unknown result type (might be due to invalid IL or missing references)
//IL_032d: Unknown result type (might be due to invalid IL or missing references)
//IL_0332: Unknown result type (might be due to invalid IL or missing references)
//IL_034c: Unknown result type (might be due to invalid IL or missing references)
//IL_0351: Unknown result type (might be due to invalid IL or missing references)
//IL_036b: Unknown result type (might be due to invalid IL or missing references)
//IL_0370: Unknown result type (might be due to invalid IL or missing references)
mAmo_ = mAmo;
mWav_ = mWav;
mCha_ = mCha;
mChaR_ = mChaR;
mTyp_ = mTyp;
mLvl_ = mLvl + mTyp_;
eRate = mRat;
eWander = mWan;
switch (mSpa)
{
case 0:
Vector_X1 = ((Component)Area_01).transform.position.x;
Vector_Y1 = ((Component)Area_01).transform.position.y;
Vector_Z1 = ((Component)Area_01).transform.position.z;
Vector_X2 = ((Component)Area_02).transform.position.x;
Vector_Y2 = ((Component)Area_02).transform.position.y;
Vector_Z2 = ((Component)Area_02).transform.position.z;
break;
case 1:
Vector_X1 = ((Component)Building_01).transform.position.x;
Vector_Y1 = ((Component)Building_01).transform.position.y;
Vector_Z1 = ((Component)Building_01).transform.position.z;
Vector_X2 = ((Component)Building_02).transform.position.x;
Vector_Y2 = ((Component)Building_02).transform.position.y;
Vector_Z2 = ((Component)Building_02).transform.position.z;
break;
case 2:
Vector_X1 = ((Component)Defense_01).transform.position.x;
Vector_Y1 = ((Component)Defense_01).transform.position.y;
Vector_Z1 = ((Component)Defense_01).transform.position.z;
Vector_X2 = ((Component)Defense_02).transform.position.x;
Vector_Y2 = ((Component)Defense_02).transform.position.y;
Vector_Z2 = ((Component)Defense_02).transform.position.z;
break;
case 3:
Vector_X1 = ((Component)Marksman_01).transform.position.x;
Vector_Y1 = ((Component)Marksman_01).transform.position.y;
Vector_Z1 = ((Component)Marksman_01).transform.position.z;
Vector_X2 = ((Component)Marksman_02).transform.position.x;
Vector_Y2 = ((Component)Marksman_02).transform.position.y;
Vector_Z2 = ((Component)Marksman_02).transform.position.z;
break;
}
mSfpmin_ = mSfpmin;
mSfpmax_ = mSfpmax;
mSwpmin_ = mSwpmin;
mSwpmax_ = mSwpmax;
mCle_ = mCle;
mFsr_ = mFsr;
mTim_ = mTim;
mpSp_ = mpSp;
GM.CurrentPlayerBody.SetHealthThreshold((float)mpHe);
GM.CurrentPlayerBody.ResetHealth();
}
private IEnumerator Exito(float t)
{
yield return (object)new WaitForSeconds(t);
GM.CurrentMovementManager.TeleportToPoint(endgamePoint.position, true, endgamePoint.forward);
summaryText.text = "* YOU WON *";
Lastrecord.text = "-- Last record: " + Lastrecord_ + " --";
killsText.text = dLabel + " " + ene_lab + ": " + kills;
float time_score = (float)timePlaying.TotalSeconds;
if (time_score < mTim_ || mTim_ == 0f)
{
PlayerPrefs.SetFloat("Time_" + mMod, time_score);
summaryText.text = "* YOU WON (new record) *";
}
PlayerPrefs.SetInt("Winnnings_" + mMod, ++Win_);
PlayerPrefs.SetFloat("Gameplay_" + mMod, Gam_ += time_score);
PlayerPrefs.SetInt("Enemies_" + mMod, Ene_ += kills);
}
private IEnumerator Callspawns(float t)
{
while (spawnedSosigs.Count < mAmo_ && spawncount < spawnamount && runtimer)
{
if (!ESPSecured())
{
continue;
}
Vector3 sppos = ((Component)Checker_).transform.position;
Vector3 plpos = ((mFsr_ != 1) ? ((Component)Center_).transform.position : ((Component)GM.CurrentPlayerBody).transform.position);
float dist = Vector3.Distance(sppos, plpos);
if (dist >= Max_Range_Sp * ((float)mSfpmin_ / 100f) && dist <= Max_Range_Sp * ((float)mSfpmax_ / 100f))
{
randomsS = Random.Range(1, 101);
if (randomsS <= eRate)
{
sosigSpawners = sosigSpawners_Guard[mLvl_ - 1];
}
else
{
sosigSpawners = sosigSpawners_Assault[mLvl_ - 1];
}
((Component)sosigSpawners).transform.position = ((Component)Checker_).transform.position;
((Component)sosigSpawners).transform.rotation = Quaternion.Euler(0f, (float)Random.Range(1, 360), 0f);
sosigSpawners.Spawn();
spawncount++;
yield return (object)new WaitForSeconds(t);
}
}
if (FirstES)
{
FirstES = false;
mFsr_ = 1;
mSfpmin_ = mSwpmin_;
mSfpmax_ = mSwpmax_;
}
if (spawncount < spawnamount)
{
Spawnmonitor = true;
}
}
private bool ESPSecured()
{
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0102: Unknown result type (might be due to invalid IL or missing references)
//IL_0120: Unknown result type (might be due to invalid IL or missing references)
//IL_0125: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: Unknown result type (might be due to invalid IL or missing references)
//IL_0139: Unknown result type (might be due to invalid IL or missing references)
//IL_013e: Unknown result type (might be due to invalid IL or missing references)
//IL_0145: Unknown result type (might be due to invalid IL or missing references)
//IL_0172: Unknown result type (might be due to invalid IL or missing references)
//IL_0177: Unknown result type (might be due to invalid IL or missing references)
//IL_017c: Unknown result type (might be due to invalid IL or missing references)
//IL_018b: Unknown result type (might be due to invalid IL or missing references)
//IL_0190: Unknown result type (might be due to invalid IL or missing references)
//IL_0197: Unknown result type (might be due to invalid IL or missing references)
//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
//IL_0207: Unknown result type (might be due to invalid IL or missing references)
//IL_020c: Unknown result type (might be due to invalid IL or missing references)
//IL_0211: Unknown result type (might be due to invalid IL or missing references)
//IL_0220: Unknown result type (might be due to invalid IL or missing references)
//IL_0225: Unknown result type (might be due to invalid IL or missing references)
//IL_022c: Unknown result type (might be due to invalid IL or missing references)
//IL_0259: Unknown result type (might be due to invalid IL or missing references)
//IL_025e: Unknown result type (might be due to invalid IL or missing references)
//IL_0263: Unknown result type (might be due to invalid IL or missing references)
//IL_0272: Unknown result type (might be due to invalid IL or missing references)
//IL_0277: Unknown result type (might be due to invalid IL or missing references)
//IL_027e: Unknown result type (might be due to invalid IL or missing references)
//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
//IL_0307: Unknown result type (might be due to invalid IL or missing references)
//IL_030c: Unknown result type (might be due to invalid IL or missing references)
//IL_0313: Unknown result type (might be due to invalid IL or missing references)
//IL_0340: Unknown result type (might be due to invalid IL or missing references)
//IL_0345: Unknown result type (might be due to invalid IL or missing references)
//IL_034a: Unknown result type (might be due to invalid IL or missing references)
//IL_0359: Unknown result type (might be due to invalid IL or missing references)
//IL_035e: Unknown result type (might be due to invalid IL or missing references)
//IL_0365: Unknown result type (might be due to invalid IL or missing references)
//IL_0392: Unknown result type (might be due to invalid IL or missing references)
//IL_0397: Unknown result type (might be due to invalid IL or missing references)
//IL_039c: Unknown result type (might be due to invalid IL or missing references)
//IL_03ab: Unknown result type (might be due to invalid IL or missing references)
//IL_03b0: Unknown result type (might be due to invalid IL or missing references)
//IL_03b7: Unknown result type (might be due to invalid IL or missing references)
//IL_03d5: Unknown result type (might be due to invalid IL or missing references)
//IL_03da: Unknown result type (might be due to invalid IL or missing references)
//IL_03df: Unknown result type (might be due to invalid IL or missing references)
//IL_03ee: Unknown result type (might be due to invalid IL or missing references)
//IL_03f3: Unknown result type (might be due to invalid IL or missing references)
//IL_03fa: Unknown result type (might be due to invalid IL or missing references)
//IL_0427: Unknown result type (might be due to invalid IL or missing references)
//IL_042c: Unknown result type (might be due to invalid IL or missing references)
//IL_0431: Unknown result type (might be due to invalid IL or missing references)
//IL_0440: Unknown result type (might be due to invalid IL or missing references)
//IL_0445: Unknown result type (might be due to invalid IL or missing references)
//IL_044c: Unknown result type (might be due to invalid IL or missing references)
//IL_0479: Unknown result type (might be due to invalid IL or missing references)
//IL_047e: Unknown result type (might be due to invalid IL or missing references)
//IL_0483: Unknown result type (might be due to invalid IL or missing references)
//IL_0492: Unknown result type (might be due to invalid IL or missing references)
//IL_0497: Unknown result type (might be due to invalid IL or missing references)
//IL_049e: Unknown result type (might be due to invalid IL or missing references)
//IL_04cb: Unknown result type (might be due to invalid IL or missing references)
//IL_04d0: Unknown result type (might be due to invalid IL or missing references)
//IL_04d5: Unknown result type (might be due to invalid IL or missing references)
//IL_04e4: Unknown result type (might be due to invalid IL or missing references)
//IL_04e9: Unknown result type (might be due to invalid IL or missing references)
//IL_04f0: Unknown result type (might be due to invalid IL or missing references)
//IL_051d: Unknown result type (might be due to invalid IL or missing references)
//IL_0522: Unknown result type (might be due to invalid IL or missing references)
//IL_0527: Unknown result type (might be due to invalid IL or missing references)
//IL_0536: Unknown result type (might be due to invalid IL or missing references)
//IL_053b: Unknown result type (might be due to invalid IL or missing references)
//IL_0542: Unknown result type (might be due to invalid IL or missing references)
//IL_056f: Unknown result type (might be due to invalid IL or missing references)
//IL_0574: Unknown result type (might be due to invalid IL or missing references)
//IL_0579: Unknown result type (might be due to invalid IL or missing references)
//IL_0588: Unknown result type (might be due to invalid IL or missing references)
//IL_058d: Unknown result type (might be due to invalid IL or missing references)
//IL_0594: Unknown result type (might be due to invalid IL or missing references)
//IL_05c1: Unknown result type (might be due to invalid IL or missing references)
//IL_05c6: Unknown result type (might be due to invalid IL or missing references)
//IL_05cb: Unknown result type (might be due to invalid IL or missing references)
//IL_05da: Unknown result type (might be due to invalid IL or missing references)
//IL_05df: Unknown result type (might be due to invalid IL or missing references)
//IL_05e6: Unknown result type (might be due to invalid IL or missing references)
//IL_0613: Unknown result type (might be due to invalid IL or missing references)
//IL_0618: Unknown result type (might be due to invalid IL or missing references)
//IL_061d: Unknown result type (might be due to invalid IL or missing references)
//IL_062c: Unknown result type (might be due to invalid IL or missing references)
//IL_0631: Unknown result type (might be due to invalid IL or missing references)
//IL_0638: Unknown result type (might be due to invalid IL or missing references)
//IL_0665: Unknown result type (might be due to invalid IL or missing references)
//IL_066a: Unknown result type (might be due to invalid IL or missing references)
//IL_066f: Unknown result type (might be due to invalid IL or missing references)
//IL_0671: Unknown result type (might be due to invalid IL or missing references)
//IL_069e: Unknown result type (might be due to invalid IL or missing references)
//IL_06a3: Unknown result type (might be due to invalid IL or missing references)
//IL_06a8: Unknown result type (might be due to invalid IL or missing references)
//IL_06b7: Unknown result type (might be due to invalid IL or missing references)
//IL_06bc: Unknown result type (might be due to invalid IL or missing references)
//IL_06c3: Unknown result type (might be due to invalid IL or missing references)
//IL_06f0: Unknown result type (might be due to invalid IL or missing references)
//IL_06f5: Unknown result type (might be due to invalid IL or missing references)
//IL_06fa: Unknown result type (might be due to invalid IL or missing references)
//IL_0709: Unknown result type (might be due to invalid IL or missing references)
//IL_070e: Unknown result type (might be due to invalid IL or missing references)
//IL_0715: Unknown result type (might be due to invalid IL or missing references)
//IL_0742: Unknown result type (might be due to invalid IL or missing references)
//IL_0747: Unknown result type (might be due to invalid IL or missing references)
//IL_074c: Unknown result type (might be due to invalid IL or missing references)
//IL_075b: Unknown result type (might be due to invalid IL or missing references)
//IL_0760: Unknown result type (might be due to invalid IL or missing references)
//IL_0767: Unknown result type (might be due to invalid IL or missing references)
//IL_0794: Unknown result type (might be due to invalid IL or missing references)
//IL_0799: Unknown result type (might be due to invalid IL or missing references)
//IL_079e: Unknown result type (might be due to invalid IL or missing references)
//IL_07ad: Unknown result type (might be due to invalid IL or missing references)
//IL_07b2: Unknown result type (might be due to invalid IL or missing references)
//IL_07b9: Unknown result type (might be due to invalid IL or missing references)
//IL_07e6: Unknown result type (might be due to invalid IL or missing references)
//IL_07eb: Unknown result type (might be due to invalid IL or missing references)
//IL_07f0: Unknown result type (might be due to invalid IL or missing references)
//IL_07ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0804: Unknown result type (might be due to invalid IL or missing references)
//IL_080b: Unknown result type (might be due to invalid IL or missing references)
//IL_0838: Unknown result type (might be due to invalid IL or missing references)
//IL_083d: Unknown result type (might be due to invalid IL or missing references)
//IL_0842: Unknown result type (might be due to invalid IL or missing references)
//IL_0851: Unknown result type (might be due to invalid IL or missing references)
//IL_0856: Unknown result type (might be due to invalid IL or missing references)
//IL_085d: Unknown result type (might be due to invalid IL or missing references)
bool flag = false;
float num = 0.7f;
float num2 = 0.1f;
float num3 = 2.2f;
float num4 = 0.1f;
((Component)Checker_).transform.position = new Vector3(Random.Range(Vector_X1, Vector_X2), Random.Range(Vector_Y1, Vector_Y2), Random.Range(Vector_Z1, Vector_Z2));
Collider[] array = Physics.OverlapSphere(((Component)Checker_).transform.position, 0f);
if (array.Length > 0)
{
return false;
}
Vector3 val = ((Component)this).transform.TransformDirection(Vector3.down);
Ray val2 = default(Ray);
((Ray)(ref val2))..ctor(((Component)Checker_).transform.position, val);
flag = Physics.Raycast(val2, num4);
if (!flag)
{
return flag;
}
val = ((Component)this).transform.TransformDirection(Vector3.up);
((Ray)(ref val2))..ctor(((Component)Checker_).transform.position, val);
if (Physics.Raycast(val2, num3))
{
return false;
}
val = ((Component)this).transform.TransformDirection(Vector3.forward);
((Ray)(ref val2))..ctor(((Component)Checker_).transform.position, val);
if (Physics.Raycast(val2, num))
{
return false;
}
val = ((Component)this).transform.TransformDirection(new Vector3(0f, 1f, 1f));
((Ray)(ref val2))..ctor(((Component)Checker_).transform.position, val);
if (Physics.Raycast(val2, num))
{
return false;
}
val = ((Component)this).transform.TransformDirection(new Vector3(0f, -1f, 1f));
((Ray)(ref val2))..ctor(((Component)Checker_).transform.position, val);
if (Physics.Raycast(val2, num2))
{
return false;
}
val = ((Component)this).transform.TransformDirection(Vector3.back);
((Ray)(ref val2))..ctor(((Component)Checker_).transform.position, val);
if (Physics.Raycast(val2, num))
{
return false;
}
val = ((Component)this).transform.TransformDirection(new Vector3(0f, 1f, -1f));
((Ray)(ref val2))..ctor(((Component)Checker_).transform.position, val);
if (Physics.Raycast(val2, num))
{
return false;
}
val = ((Component)this).transform.TransformDirection(new Vector3(0f, -1f, -1f));
((Ray)(ref val2))..ctor(((Component)Checker_).transform.position, val);
if (Physics.Raycast(val2, num2))
{
return false;
}
val = ((Component)this).transform.TransformDirection(Vector3.right);
((Ray)(ref val2))..ctor(((Component)Checker_).transform.position, val);
if (Physics.Raycast(val2, num))
{
return false;
}
val = ((Component)this).transform.TransformDirection(new Vector3(1f, 1f, 0f));
((Ray)(ref val2))..ctor(((Component)Checker_).transform.position, val);
if (Physics.Raycast(val2, num))
{
return false;
}
val = ((Component)this).transform.TransformDirection(new Vector3(1f, -1f, 0f));
((Ray)(ref val2))..ctor(((Component)Checker_).transform.position, val);
if (Physics.Raycast(val2, num2))
{
return false;
}
val = ((Component)this).transform.TransformDirection(Vector3.left);
((Ray)(ref val2))..ctor(((Component)Checker_).transform.position, val);
if (Physics.Raycast(val2, num))
{
return false;
}
val = ((Component)this).transform.TransformDirection(new Vector3(-1f, 1f, 0f));
((Ray)(ref val2))..ctor(((Component)Checker_).transform.position, val);
if (Physics.Raycast(val2, num))
{
return false;
}
val = ((Component)this).transform.TransformDirection(new Vector3(-1f, -1f, 0f));
((Ray)(ref val2))..ctor(((Component)Checker_).transform.position, val);
if (Physics.Raycast(val2, num2))
{
return false;
}
val = ((Component)this).transform.TransformDirection(new Vector3(1f, 0f, 1f));
((Ray)(ref val2))..ctor(((Component)Checker_).transform.position, val);
if (Physics.Raycast(val2, num))
{
return false;
}
val = ((Component)this).transform.TransformDirection(new Vector3(1f, 1f, 1f));
((Ray)(ref val2))..ctor(((Component)Checker_).transform.position, val);
if (Physics.Raycast(val2, num))
{
return false;
}
val = ((Component)this).transform.TransformDirection(new Vector3(1f, -1f, 1f));
((Ray)(ref val2))..ctor(((Component)Checker_).transform.position, val);
if (Physics.Raycast(val2, num2))
{
return false;
}
val = ((Component)this).transform.TransformDirection(new Vector3(1f, 0f, -1f));
((Ray)(ref val2))..ctor(((Component)Checker_).transform.position, val);
if (Physics.Raycast(val2, num))
{
return false;
}
val = ((Component)this).transform.TransformDirection(new Vector3(1f, 1f, -1f));
((Ray)(ref val2))..ctor(((Component)Checker_).transform.position, val);
if (Physics.Raycast(val2, num))
{
return false;
}
val = ((Component)this).transform.TransformDirection(new Vector3(1f, -1f, -1f));
if (Physics.Raycast(val2, num2))
{
return false;
}
val = ((Component)this).transform.TransformDirection(new Vector3(-1f, 0f, 1f));
((Ray)(ref val2))..ctor(((Component)Checker_).transform.position, val);
if (Physics.Raycast(val2, num))
{
return false;
}
val = ((Component)this).transform.TransformDirection(new Vector3(-1f, 1f, 1f));
((Ray)(ref val2))..ctor(((Component)Checker_).transform.position, val);
if (Physics.Raycast(val2, num))
{
return false;
}
val = ((Component)this).transform.TransformDirection(new Vector3(-1f, -1f, 1f));
((Ray)(ref val2))..ctor(((Component)Checker_).transform.position, val);
if (Physics.Raycast(val2, num2))
{
return false;
}
val = ((Component)this).transform.TransformDirection(new Vector3(-1f, 0f, -1f));
((Ray)(ref val2))..ctor(((Component)Checker_).transform.position, val);
if (Physics.Raycast(val2, num))
{
return false;
}
val = ((Component)this).transform.TransformDirection(new Vector3(-1f, 1f, -1f));
((Ray)(ref val2))..ctor(((Component)Checker_).transform.position, val);
if (Physics.Raycast(val2, num))
{
return false;
}
val = ((Component)this).transform.TransformDirection(new Vector3(-1f, -1f, -1f));
((Ray)(ref val2))..ctor(((Component)Checker_).transform.position, val);
if (Physics.Raycast(val2, num2))
{
return false;
}
return true;
}
}
public class SosigMarker : MonoBehaviour
{
public Sosig sosig;
public void Awake()
{
sosig = ((Component)this).GetComponent<Sosig>();
}
}
public class Spawner : MonoBehaviour
{
public SosigEnemyID[] spawnableSosigs;
public OnslaughtManager osm;
private readonly SpawnOptions _spawnOptions_Assault;
private readonly SpawnOptions _spawnOptions_Guard;
private readonly SpawnOptions _spawnOptions_Wander;
public Spawner()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Expected O, but got Unknown
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Expected O, but got Unknown
SpawnOptions val = new SpawnOptions();
val.SpawnState = (SosigOrder)7;
val.SpawnActivated = true;
val.EquipmentMode = (EquipmentSlots)7;
val.SpawnWithFullAmmo = true;
val.IFF = 1;
_spawnOptions_Assault = val;
val = new SpawnOptions();
val.SpawnState = (SosigOrder)1;
val.SpawnActivated = true;
val.EquipmentMode = (EquipmentSlots)7;
val.SpawnWithFullAmmo = true;
val.IFF = 1;
_spawnOptions_Guard = val;
val = new SpawnOptions();
val.SpawnState = (SosigOrder)6;
val.SpawnActivated = true;
val.EquipmentMode = (EquipmentSlots)7;
val.SpawnWithFullAmmo = true;
val.IFF = 1;
_spawnOptions_Wander = val;
((MonoBehaviour)this)..ctor();
}
private void Update()
{
if ((Object)(object)osm == (Object)null)
{
osm = Object.FindObjectOfType<OnslaughtManager>();
}
}
public void Spawn()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: Unknown result type (might be due to invalid IL or missing references)
//IL_013c: Unknown result type (might be due to invalid IL or missing references)
//IL_0147: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
SosigEnemyID random = SodaliteUtils.GetRandom<SosigEnemyID>((IList<SosigEnemyID>)spawnableSosigs);
if (osm.randomsS <= osm.eRate)
{
_spawnOptions_Guard.SosigTargetPosition = ((Component)this).transform.position;
Sosig val = SosigAPI.Spawn(ManagerSingleton<IM>.Instance.odicSosigObjsByID[random], _spawnOptions_Guard, ((Component)this).transform.position, ((Component)this).transform.rotation);
SosigMarker item = ((Component)val).gameObject.AddComponent<SosigMarker>();
osm.spawnedSosigs.Add(item);
return;
}
int num = Random.Range(1, 101);
if (num <= osm.eWander)
{
Sosig val2 = SosigAPI.Spawn(ManagerSingleton<IM>.Instance.odicSosigObjsByID[random], _spawnOptions_Wander, ((Component)this).transform.position, ((Component)this).transform.rotation);
SosigMarker item2 = ((Component)val2).gameObject.AddComponent<SosigMarker>();
osm.spawnedSosigs.Add(item2);
}
else
{
_spawnOptions_Assault.SosigTargetPosition = ((Component)this).transform.position;
Sosig val3 = SosigAPI.Spawn(ManagerSingleton<IM>.Instance.odicSosigObjsByID[random], _spawnOptions_Assault, ((Component)this).transform.position, ((Component)this).transform.rotation);
SosigMarker item3 = ((Component)val3).gameObject.AddComponent<SosigMarker>();
osm.spawnedSosigs.Add(item3);
}
}
}
}
namespace SimpleLightProbePlacer
{
[RequireComponent(typeof(LightProbeGroup))]
[AddComponentMenu("Rendering/Light Probe Group Control")]
public class LightProbeGroupControl : MonoBehaviour
{
[SerializeField]
private float m_mergeDistance = 0.5f;
[SerializeField]
private bool m_usePointLights = true;
[SerializeField]
private float m_pointLightRange = 1f;
private int m_mergedProbes;
private LightProbeGroup m_lightProbeGroup;
public float MergeDistance
{
get
{
return m_mergeDistance;
}
set
{
m_mergeDistance = value;
}
}
public int MergedProbes => m_mergedProbes;
public bool UsePointLights
{
get
{
return m_usePointLights;
}
set
{
m_usePointLights = value;
}
}
public float PointLightRange
{
get
{
return m_pointLightRange;
}
set
{
m_pointLightRange = value;
}
}
public LightProbeGroup LightProbeGroup
{
get
{
if ((Object)(object)m_lightProbeGroup != (Object)null)
{
return m_lightProbeGroup;
}
return m_lightProbeGroup = ((Component)this).GetComponent<LightProbeGroup>();
}
}
public void DeleteAll()
{
LightProbeGroup.probePositions = null;
m_mergedProbes = 0;
}
public void Create()
{
DeleteAll();
List<Vector3> list = CreatePositions();
list.AddRange(CreateAroundPointLights(m_pointLightRange));
list = MergeClosestPositions(list, m_mergeDistance, out m_mergedProbes);
ApplyPositions(list);
}
public void Merge()
{
if (LightProbeGroup.probePositions != null)
{
List<Vector3> source = MergeClosestPositions(LightProbeGroup.probePositions.ToList(), m_mergeDistance, out m_mergedProbes);
source = source.Select((Vector3 x) => ((Component)this).transform.TransformPoint(x)).ToList();
ApplyPositions(source);
}
}
private void ApplyPositions(List<Vector3> positions)
{
LightProbeGroup.probePositions = positions.Select((Vector3 x) => ((Component)this).transform.InverseTransformPoint(x)).ToArray();
}
private static List<Vector3> CreatePositions()
{
LightProbeVolume[] array = Object.FindObjectsOfType<LightProbeVolume>();
if (array.Length == 0)
{
return new List<Vector3>();
}
List<Vector3> list = new List<Vector3>();
for (int i = 0; i < array.Length; i++)
{
list.AddRange(array[i].CreatePositions());
}
return list;
}
private static List<Vector3> CreateAroundPointLights(float range)
{
List<Light> list = (from x in Object.FindObjectsOfType<Light>()
where (int)x.type == 2
select x).ToList();
if (list.Count == 0)
{
return new List<Vector3>();
}
List<Vector3> list2 = new List<Vector3>();
for (int i = 0; i < list.Count; i++)
{
list2.AddRange(CreatePositionsAround(((Component)list[i]).transform, range));
}
return list2;
}
private static List<Vector3> MergeClosestPositions(List<Vector3> positions, float distance, out int mergedCount)
{
//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_0127: Unknown result type (might be due to invalid IL or missing references)
//IL_0131: Unknown result type (might be due to invalid IL or missing references)
//IL_0153: Unknown result type (might be due to invalid IL or missing references)
//IL_015e: Unknown result type (might be due to invalid IL or missing references)
//IL_016e: Unknown result type (might be due to invalid IL or missing references)
//IL_0173: Unknown result type (might be due to invalid IL or missing references)
//IL_019d: Unknown result type (might be due to invalid IL or missing references)
if (positions == null)
{
mergedCount = 0;
return new List<Vector3>();
}
int count = positions.Count;
bool flag = false;
while (!flag)
{
Dictionary<Vector3, List<Vector3>> dictionary = new Dictionary<Vector3, List<Vector3>>();
for (int i = 0; i < positions.Count; i++)
{
List<Vector3> list = positions.Where(delegate(Vector3 x)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
Vector3 val2 = x - positions[i];
return ((Vector3)(ref val2)).magnitude < distance;
}).ToList();
if (list.Count > 0 && !dictionary.ContainsKey(positions[i]))
{
dictionary.Add(positions[i], list);
}
}
positions.Clear();
List<Vector3> list2 = dictionary.Keys.ToList();
for (int j = 0; j < list2.Count; j++)
{
Vector3 center = dictionary[list2[j]].Aggregate(Vector3.zero, (Vector3 result, Vector3 target) => result + target) / (float)dictionary[list2[j]].Count;
if (!positions.Exists((Vector3 x) => x == center))
{
positions.Add(center);
}
}
flag = positions.Select((Vector3 x) => positions.Where(delegate(Vector3 y)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
int result2;
if (y != x)
{
Vector3 val = y - x;
result2 = ((((Vector3)(ref val)).magnitude < distance) ? 1 : 0);
}
else
{
result2 = 0;
}
return (byte)result2 != 0;
})).All((IEnumerable<Vector3> x) => !x.Any());
}
mergedCount = count - positions.Count;
return positions;
}
public static List<Vector3> CreatePositionsAround(Transform transform, float range)
{
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_0111: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
Vector3[] source = (Vector3[])(object)new Vector3[8]
{
new Vector3(-0.5f, 0.5f, -0.5f),
new Vector3(-0.5f, 0.5f, 0.5f),
new Vector3(0.5f, 0.5f, 0.5f),
new Vector3(0.5f, 0.5f, -0.5f),
new Vector3(-0.5f, -0.5f, -0.5f),
new Vector3(-0.5f, -0.5f, 0.5f),
new Vector3(0.5f, -0.5f, 0.5f),
new Vector3(0.5f, -0.5f, -0.5f)
};
return source.Select((Vector3 x) => transform.TransformPoint(x * range)).ToList();
}
}
public enum LightProbeVolumeType
{
Fixed,
Float
}
[AddComponentMenu("Rendering/Light Probe Volume")]
public class LightProbeVolume : TransformVolume
{
[SerializeField]
private LightProbeVolumeType m_type = LightProbeVolumeType.Fixed;
[SerializeField]
private Vector3 m_densityFixed = Vector3.one;
[SerializeField]
private Vector3 m_densityFloat = Vector3.one;
public LightProbeVolumeType Type
{
get
{
return m_type;
}
set
{
m_type = value;
}
}
public Vector3 Density
{
get
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
return (m_type != 0) ? m_densityFloat : m_densityFixed;
}
set
{
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
if (m_type == LightProbeVolumeType.Fixed)
{
m_densityFixed = value;
}
else
{
m_densityFloat = value;
}
}
}
public static Color EditorColor => new Color(1f, 0.9f, 0.25f);
public List<Vector3> CreatePositions()
{
return CreatePositions(m_type);
}
public List<Vector3> CreatePositions(LightProbeVolumeType type)
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
return (type != 0) ? CreatePositionsFloat(((Component)this).transform, base.Origin, base.Size, Density) : CreatePositionsFixed(((Component)this).transform, base.Origin, base.Size, Density);
}
public static List<Vector3> CreatePositionsFixed(Transform volumeTransform, Vector3 origin, Vector3 size, Vector3 density)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_008a: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_0094: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
List<Vector3> list = new List<Vector3>();
Vector3 val = origin;
float num = size.x / (float)Mathf.FloorToInt(density.x);
float num2 = size.y / (float)Mathf.FloorToInt(density.y);
float num3 = size.z / (float)Mathf.FloorToInt(density.z);
val -= size * 0.5f;
for (int i = 0; (float)i <= density.x; i++)
{
for (int j = 0; (float)j <= density.y; j++)
{
for (int k = 0; (float)k <= density.z; k++)
{
Vector3 val2 = val + new Vector3((float)i * num, (float)j * num2, (float)k * num3);
val2 = volumeTransform.TransformPoint(val2);
list.Add(val2);
}
}
}
return list;
}
public static List<Vector3> CreatePositionsFloat(Transform volumeTransform, Vector3 origin, Vector3 size, Vector3 density)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: Unknown result type (might be due to invalid IL or missing references)
//IL_0110: Unknown result type (might be due to invalid IL or missing references)
//IL_0115: Unknown result type (might be due to invalid IL or missing references)
//IL_0118: Unknown result type (might be due to invalid IL or missing references)
//IL_011a: Unknown result type (might be due to invalid IL or missing references)
//IL_011f: Unknown result type (might be due to invalid IL or missing references)
//IL_0122: Unknown result type (might be due to invalid IL or missing references)
List<Vector3> list = new List<Vector3>();
Vector3 val = origin;
int num = Mathf.FloorToInt(size.x / density.x);
int num2 = Mathf.FloorToInt(size.y / density.y);
int num3 = Mathf.FloorToInt(size.z / density.z);
val -= size * 0.5f;
val.x += (size.x - (float)num * density.x) * 0.5f;
val.y += (size.y - (float)num2 * density.y) * 0.5f;
val.z += (size.z - (float)num3 * density.z) * 0.5f;
for (int i = 0; i <= num; i++)
{
for (int j = 0; j <= num2; j++)
{
for (int k = 0; k <= num3; k++)
{
Vector3 val2 = val + new Vector3((float)i * density.x, (float)j * density.y, (float)k * density.z);
val2 = volumeTransform.TransformPoint(val2);
list.Add(val2);
}
}
}
return list;
}
}
[AddComponentMenu("")]
public class TransformVolume : MonoBehaviour
{
[SerializeField]
private Volume m_volume = new Volume(Vector3.zero, Vector3.one);
public Volume Volume
{
get
{
return m_volume;
}
set
{
m_volume = value;
}
}
public Vector3 Origin => m_volume.Origin;
public Vector3 Size => m_volume.Size;
public bool IsInBounds(Vector3[] points)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
Bounds bounds = GetBounds();
return ((Bounds)(ref bounds)).Intersects(GetBounds(points));
}
public bool IsOnBorder(Vector3[] points)
{
if (points.All((Vector3 x) => !IsInVolume(x)))
{
return false;
}
return !points.All(IsInVolume);
}
public bool IsInVolume(Vector3[] points)
{
return points.All(IsInVolume);
}
public bool IsInVolume(Vector3 position)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
Plane val = default(Plane);
for (int i = 0; i < 6; i++)
{
((Plane)(ref val))..ctor(GetSideDirection(i), GetSidePosition(i));
if (((Plane)(ref val)).GetSide(position))
{
return false;
}
}
return true;
}
public Vector3[] GetCorners()
{
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_009d: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0102: Unknown result type (might be due to invalid IL or missing references)
//IL_0123: Unknown result type (might be due to invalid IL or missing references)
//IL_0128: Unknown result type (might be due to invalid IL or missing references)
//IL_0149: Unknown result type (might be due to invalid IL or missing references)
//IL_014e: Unknown result type (might be due to invalid IL or missing references)
//IL_016f: Unknown result type (might be due to invalid IL or missing references)
//IL_0174: Unknown result type (might be due to invalid IL or missing references)
//IL_0196: Unknown result type (might be due to invalid IL or missing references)
//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
Vector3[] array = (Vector3[])(object)new Vector3[8]
{
new Vector3(-0.5f, 0.5f, -0.5f),
new Vector3(-0.5f, 0.5f, 0.5f),
new Vector3(0.5f, 0.5f, 0.5f),
new Vector3(0.5f, 0.5f, -0.5f),
new Vector3(-0.5f, -0.5f, -0.5f),
new Vector3(-0.5f, -0.5f, 0.5f),
new Vector3(0.5f, -0.5f, 0.5f),
new Vector3(0.5f, -0.5f, -0.5f)
};
for (int i = 0; i < array.Length; i++)
{
ref Vector3 reference = ref array[i];
reference.x *= m_volume.Size.x;
ref Vector3 reference2 = ref array[i];
reference2.y *= m_volume.Size.y;
ref Vector3 reference3 = ref array[i];
reference3.z *= m_volume.Size.z;
ref Vector3 reference4 = ref array[i];
reference4 = ((Component)this).transform.TransformPoint(m_volume.Origin + array[i]);
}
return array;
}
public Bounds GetBounds()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
return GetBounds(GetCorners());
}
public Bounds GetBounds(Vector3[] points)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
Vector3 val = points.Aggregate(Vector3.zero, (Vector3 result, Vector3 point) => result + point) / (float)points.Length;
Bounds result2 = default(Bounds);
((Bounds)(ref result2))..ctor(val, Vector3.zero);
for (int i = 0; i < points.Length; i++)
{
((Bounds)(ref result2)).Encapsulate(points[i]);
}
return result2;
}
public GameObject[] GetGameObjectsInBounds(LayerMask layerMask)
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
MeshRenderer[] array = Object.FindObjectsOfType<MeshRenderer>();
List<GameObject> list = new List<GameObject>();
Bounds bounds = GetBounds();
for (int i = 0; i < array.Length; i++)
{
if (!((Object)(object)((Component)array[i]).gameObject == (Object)(object)((Component)((Component)this).transform).gameObject) && !((Object)(object)((Component)array[i]).GetComponent<TransformVolume>() != (Object)null) && ((1 << ((Component)array[i]).gameObject.layer) & ((LayerMask)(ref layerMask)).value) != 0 && ((Bounds)(ref bounds)).Intersects(((Renderer)array[i]).bounds))
{
list.Add(((Component)array[i]).gameObject);
}
}
return list.ToArray();
}
public Vector3 GetSideDirection(int side)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
Vector3[] array = (Vector3[])(object)new Vector3[6];
Vector3 right = Vector3.right;
Vector3 up = Vector3.up;
Vector3 forward = Vector3.forward;
array[0] = right;
ref Vector3 reference = ref array[1];
reference = -right;
array[2] = up;
ref Vector3 reference2 = ref array[3];
reference2 = -up;
array[4] = forward;
ref Vector3 reference3 = ref array[5];
reference3 = -forward;
return ((Component)this).transform.TransformDirection(array[side]);
}
public Vector3 GetSidePosition(int side)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
Vector3[] array = (Vector3[])(object)new Vector3[6];
Vector3 right = Vector3.right;
Vector3 up = Vector3.up;
Vector3 forward = Vector3.forward;
array[0] = right;
ref Vector3 reference = ref array[1];
reference = -right;
array[2] = up;
ref Vector3 reference2 = ref array[3];
reference2 = -up;
array[4] = forward;
ref Vector3 reference3 = ref array[5];
reference3 = -forward;
return ((Component)this).transform.TransformPoint(array[side] * GetSizeAxis(side) + m_volume.Origin);
}
public float GetSizeAxis(int side)
{
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
switch (side)
{
case 0:
case 1:
return m_volume.Size.x * 0.5f;
case 2:
case 3:
return m_volume.Size.y * 0.5f;
default:
return m_volume.Size.z * 0.5f;
}
}
public static Volume EditorVolumeControl(TransformVolume transformVolume, float handleSize, Color color)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Expected O, but got Unknown
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
//IL_00de: Unknown result type (might be due to invalid IL or missing references)
//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Expected O, but got Unknown
//IL_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_0111: Unknown result type (might be due to invalid IL or missing references)
//IL_0124: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: Unknown result type (might be due to invalid IL or missing references)
//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
//IL_0102: Expected O, but got Unknown
//IL_0152: Unknown result type (might be due to invalid IL or missing references)
//IL_0157: Unknown result type (might be due to invalid IL or missing references)
//IL_016a: Unknown result type (might be due to invalid IL or missing references)
//IL_0170: Unknown result type (might be due to invalid IL or missing references)
//IL_013e: Unknown result type (might be due to invalid IL or missing references)
//IL_0148: Expected O, but got Unknown
//IL_0198: Unknown result type (might be due to invalid IL or missing references)
//IL_019d: Unknown result type (might be due to invalid IL or missing references)
//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
//IL_0184: Unknown result type (might be due to invalid IL or missing references)
//IL_018e: Expected O, but got Unknown
//IL_01de: Unknown result type (might be due to invalid IL or missing references)
//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0203: Unknown result type (might be due to invalid IL or missing references)
//IL_020d: Unknown result type (might be due to invalid IL or missing references)
//IL_0212: Unknown result type (might be due to invalid IL or missing references)
//IL_0217: Unknown result type (might be due to invalid IL or missing references)
//IL_022f: Unknown result type (might be due to invalid IL or missing references)
//IL_023b: Unknown result type (might be due to invalid IL or missing references)
//IL_0240: Unknown result type (might be due to invalid IL or missing references)
//IL_024a: Unknown result type (might be due to invalid IL or missing references)
//IL_024f: Unknown result type (might be due to invalid IL or missing references)
//IL_0254: Unknown result type (might be due to invalid IL or missing references)
//IL_026c: Unknown result type (might be due to invalid IL or missing references)
//IL_0278: Unknown result type (might be due to invalid IL or missing references)
//IL_027d: Unknown result type (might be due to invalid IL or missing references)
//IL_0287: Unknown result type (might be due to invalid IL or missing references)
//IL_028c: Unknown result type (might be due to invalid IL or missing references)
//IL_0291: Unknown result type (might be due to invalid IL or missing references)
//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
//IL_02ce: Unknown result type (might be due to invalid IL or missing references)
//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
//IL_02f1: Unknown result type (might be due to invalid IL or missing references)
//IL_0302: Unknown result type (might be due to invalid IL or missing references)
//IL_0307: Unknown result type (might be due to invalid IL or missing references)
//IL_030c: Unknown result type (might be due to invalid IL or missing references)
//IL_0325: Unknown result type (might be due to invalid IL or missing references)
//IL_032a: Unknown result type (might be due to invalid IL or missing references)
//IL_032f: Unknown result type (might be due to invalid IL or missing references)
//IL_0340: Unknown result type (might be due to invalid IL or missing references)
//IL_0345: Unknown result type (might be due to invalid IL or missing references)
//IL_034a: Unknown result type (might be due to invalid IL or missing references)
//IL_0359: Unknown result type (might be due to invalid IL or missing references)
//IL_035a: Unknown result type (might be due to invalid IL or missing references)
//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
//IL_01d4: Expected O, but got Unknown
Vector3[] array = (Vector3[])(object)new Vector3[6];
Transform transform = ((Component)transformVolume).transform;
Handles.color = color;
for (int i = 0; i < array.Length; i++)
{
ref Vector3 reference = ref array[i];
reference = transformVolume.GetSidePosition(i);
}
ref Vector3 reference2 = ref array[0];
reference2 = Handles.Slider(array[0], transform.right, handleSize, new CapFunction(Handles.DotHandleCap), 1f);
ref Vector3 reference3 = ref array[1];
reference3 = Handles.Slider(array[1], transform.right, handleSize, new CapFunction(Handles.DotHandleCap), 1f);
ref Vector3 reference4 = ref array[2];
reference4 = Handles.Slider(array[2], transform.up, handleSize, new CapFunction(Handles.DotHandleCap), 1f);
ref Vector3 reference5 = ref array[3];
reference5 = Handles.Slider(array[3], transform.up, handleSize, new CapFunction(Handles.DotHandleCap), 1f);
ref Vector3 reference6 = ref array[4];
reference6 = Handles.Slider(array[4], transform.forward, handleSize, new CapFunction(Handles.DotHandleCap), 1f);
ref Vector3 reference7 = ref array[5];
reference7 = Handles.Slider(array[5], transform.forward, handleSize, new CapFunction(Handles.DotHandleCap), 1f);
Vector3 origin = default(Vector3);
origin.x = transform.InverseTransformPoint((array[0] + array[1]) * 0.5f).x;
origin.y = transform.InverseTransformPoint((array[2] + array[3]) * 0.5f).y;
origin.z = transform.InverseTransformPoint((array[4] + array[5]) * 0.5f).z;
Vector3 size = default(Vector3);
size.x = transform.InverseTransformPoint(array[0]).x - transform.InverseTransformPoint(array[1]).x;
size.y = transform.InverseTransformPoint(array[2]).y - transform.InverseTransformPoint(array[3]).y;
size.z = transform.InverseTransformPoint(array[4]).z - transform.InverseTransformPoint(array[5]).z;
return new Volume(origin, size);
}
}
[Serializable]
public struct Volume
{
[SerializeField]
private Vector3 m_origin;
[SerializeField]
private Vector3 m_size;
public Vector3 Origin => m_origin;
public Vector3 Size => m_size;
public Volume(Vector3 origin, Vector3 size)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
m_origin = origin;
m_size = size;
}
public static bool operator ==(Volume left, Volume right)
{
return left.Equals(right);
}
public static bool operator !=(Volume left, Volume right)
{
return !left.Equals(right);
}
public bool Equals(Volume other)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
return Origin == other.Origin && Size == other.Size;
}
public override bool Equals(object obj)
{
if (object.ReferenceEquals(null, obj))
{
return false;
}
return obj is Volume && Equals((Volume)obj);
}
public override int GetHashCode()
{
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
Vector3 origin = Origin;
int num = ((object)(Vector3)(ref origin)).GetHashCode() * 397;
Vector3 size = Size;
return num ^ ((object)(Vector3)(ref size)).GetHashCode();
}
public override string ToString()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
return $"Origin: {Origin}, Size: {Size}";
}
}
}
namespace nrgill28.AtlasSampleScene
{
public class CTF_CaptureZone : MonoBehaviour
{
public CTF_Manager Manager;
public CTF_Team Team;
public void OnTriggerEnter(Collider other)
{
CTF_Flag component = ((Component)other).GetComponent<CTF_Flag>();
if (Object.op_Implicit((Object)(object)component) && component.Team != Team)
{
Manager.FlagCaptured(component);
}
}
}
public class CTF_Flag : FVRPhysicalObject
{
[Header("Flag stuffs")]
public CTF_Team Team;
public float RespawnDelay = 10f;
public Vector3 FloorOffset = new Vector3(0f, 0.25f, 0f);
private Vector3 _resetPosition;
private Quaternion _resetRotation;
private Transform _followTransform;
private bool _isHeld;
private bool _isTaken;
private float _timer;
private CTF_Sosig _heldBy;
public override void Awake()
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
((FVRPhysicalObject)this).Awake();
_resetPosition = ((Component)this).transform.position;
_resetRotation = ((Component)this).transform.rotation;
}
private void Update()
{
if (_isTaken && !_isHeld)
{
_timer -= Time.deltaTime;
if (_timer < 0f)
{
ReturnFlag();
}
}
}
public void Take()
{
_isHeld = true;
_isTaken = true;
}
public void Drop()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
((FVRInteractiveObject)this).IsHeld = false;
_timer = RespawnDelay;
NavMeshHit val = default(NavMeshHit);
NavMesh.SamplePosition(((Component)this).transform.position, ref val, 100f, -1);
((Component)this).transform.position = ((NavMeshHit)(ref val)).position + FloorOffset;
((Component)this).transform.rotation = Quaternion.identity;
}
public void ReturnFlag()
{
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
if (((FVRInteractiveObject)this).IsHeld)
{
((FVRInteractiveObject)this).ForceBreakInteraction();
}
if (Object.op_Implicit((Object)(object)_heldBy))
{
_heldBy.HeldFlag = null;
}
((Component)this).transform.SetPositionAndRotation(_resetPosition, _resetRotation);
_isTaken = false;
}
private void OnTriggerEnter(Collider other)
{
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
if (_isHeld)
{
return;
}
CTF_Sosig componentInParent = ((Component)other).GetComponentInParent<CTF_Sosig>();
if (Object.op_Implicit((Object)(object)componentInParent) && (int)componentInParent.Sosig.BodyState == 0)
{
if (componentInParent.Team == Team)
{
ReturnFlag();
return;
}
_heldBy = componentInParent;
componentInParent.HeldFlag = this;
Take();
}
}
public override void BeginInteraction(FVRViveHand hand)
{
((FVRPhysicalObject)this).BeginInteraction(hand);
Take();
}
public override void EndInteraction(FVRViveHand hand)
{
((FVRPhysicalObject)this).EndInteraction(hand);
Drop();
}
}
public class CTF_Manager : MonoBehaviour
{
[Header("References")]
public Text[] ScoreTexts;
public Transform[] AttackPoints;
public Text StartButtonText;
[Header("Red Team")]
public CTF_Flag RedFlag;
public int RedTeamSize;
public Transform[] RedSpawns;
public SosigEnemyID[] RedTeam;
[Header("Blue Team")]
public CTF_Flag BlueFlag;
public int BlueTeamSize;
public Transform[] BlueSpawns;
public SosigEnemyID[] BlueTeam;
private int _blueScore;
private int _redScore;
private bool _running;
private readonly List<CTF_Sosig> _sosigs = new List<CTF_Sosig>();
private readonly SpawnOptions _spawnOptions;
public CTF_Manager()
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
SpawnOptions val = new SpawnOptions();
val.SpawnState = (SosigOrder)7;
val.SpawnActivated = true;
val.EquipmentMode = (EquipmentSlots)7;
val.SpawnWithFullAmmo = true;
_spawnOptions = val;
((MonoBehaviour)this)..ctor();
}
private void Start()
{
UpdateScoreText();
}
public void ToggleGame()
{
if (_running)
{
EndGame();
StartButtonText.text = "Start Game";
}
else
{
StartGame();
StartButtonText.text = "Stop Game";
}
}
private void StartGame()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
ResetGame();
_running = true;
GM.CurrentSceneSettings.SosigKillEvent += new SosigKill(CurrentSceneSettingsOnSosigKillEvent);
((MonoBehaviour)this).StartCoroutine(DoInitialSpawns());
}
private void EndGame()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Expected O, but got Unknown
GM.CurrentSceneSettings.SosigKillEvent -= new SosigKill(CurrentSceneSettingsOnSosigKillEvent);
foreach (CTF_Sosig sosig in _sosigs)
{
sosig.Sosig.ClearSosig();
}
_running = false;
}
private void CurrentSceneSettingsOnSosigKillEvent(Sosig s)
{
CTF_Sosig cTF_Sosig = _sosigs.FirstOrDefault((CTF_Sosig x) => (Object)(object)x.Sosig == (Object)(object)s);
if (Object.op_Implicit((Object)(object)cTF_Sosig))
{
((MonoBehaviour)this).StartCoroutine(RespawnSosig(cTF_Sosig));
}
}
private void SpawnSosig(CTF_Team team)
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
_spawnOptions.IFF = (int)team;
_spawnOptions.SosigTargetPosition = SodaliteUtils.GetRandom<Transform>((IList<Transform>)AttackPoints).position;
Transform transform;
SosigEnemyID random;
if (team == CTF_Team.Red)
{
transform = ((Component)SodaliteUtils.GetRandom<Transform>((IList<Transform>)RedSpawns)).transform;
random = SodaliteUtils.GetRandom<SosigEnemyID>((IList<SosigEnemyID>)RedTeam);
}
else
{
transform = ((Component)SodaliteUtils.GetRandom<Transform>((IList<Transform>)BlueSpawns)).transform;
random = SodaliteUtils.GetRandom<SosigEnemyID>((IList<SosigEnemyID>)BlueTeam);
}
Sosig val = SosigAPI.Spawn(ManagerSingleton<IM>.Instance.odicSosigObjsByID[random], _spawnOptions, transform.position, transform.rotation);
CTF_Sosig cTF_Sosig = ((Component)val).gameObject.AddComponent<CTF_Sosig>();
_sosigs.Add(cTF_Sosig);
cTF_Sosig.Sosig = val;
cTF_Sosig.Team = team;
}
private IEnumerator DoInitialSpawns()
{
int i = 0;
while (i < Mathf.Max(RedTeamSize, BlueTeamSize))
{
if (i < RedTeamSize)
{
SpawnSosig(CTF_Team.Red);
}
if (i < BlueTeamSize)
{
SpawnSosig(CTF_Team.Blue);
}
i++;
yield return (object)new WaitForSeconds(2.5f);
}
}
private IEnumerator RespawnSosig(CTF_Sosig sosig)
{
yield return (object)new WaitForSeconds(5f);
sosig.Sosig.ClearSosig();
_sosigs.Remove(sosig);
yield return (object)new WaitForSeconds(5f);
if (_running)
{
int sosigsLeft = _sosigs.Count((CTF_Sosig x) => x.Team == sosig.Team);
int teamSize = ((sosig.Team != 0) ? BlueTeamSize : RedTeamSize);
if (sosigsLeft < teamSize)
{
SpawnSosig(sosig.Team);
}
}
}
public void ResetGame()
{
_blueScore = 0;
_redScore = 0;
UpdateScoreText();
if (Object.op_Implicit((Object)(object)RedFlag))
{
RedFlag.ReturnFlag();
}
if (Object.op_Implicit((Object)(object)BlueFlag))
{
BlueFlag.ReturnFlag();
}
}
public void FlagCaptured(CTF_Flag flag)
{
if (flag.Team == CTF_Team.Red)
{
_blueScore++;
}
else
{
_redScore++;
}
UpdateScoreText();
flag.ReturnFlag();
}
public void UpdateScoreText()
{
Text[] scoreTexts = ScoreTexts;
foreach (Text val in scoreTexts)
{
val.text = "<color=red>" + _redScore + "</color> - <color=blue>" + _blueScore + "</color>";
}
}
private void OnDrawGizmos()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknow