public void onTitanDown(TITAN t) { if (this.spawnedTitansHashes.Contains(t.GetHashCode())) { this.spawnedTitansHashes.Remove(t.GetHashCode()); this.currentTitans--; if (this.mode == SpawnControllerMode.WAVES && !this.customWaves.ContainsKey(this.currentWave)) { if (this.titansToSpawn > 0 && this.canSpawnTitans()) { this.titansToSpawn -= (this.maxAllowedTitans - this.currentTitans); this.spawnTitans(this.maxAllowedTitans - this.currentTitans); } } else if (this.mode == SpawnControllerMode.FIXED_SPAWN && this.titansToSpawn > 0 && this.canSpawnTitans()) { this.titansToSpawn -= (this.maxAllowedTitans - this.currentTitans); this.spawnFixedTitans(this.maxAllowedTitans - this.currentTitans); } if (this.currentTitans == 0) { this.handleAllTitansKilled(); } } }
public GameObject spawnTitan(AbnormalType type, float size, Vector3 pos, Quaternion rotation) { GameObject titanPrefab = this.instantiateTitan(pos, rotation); TITAN_SETUP setup = titanPrefab.GetComponent <TITAN_SETUP>(); TITAN titan = titanPrefab.GetComponent <TITAN>(); this.currentTitans++; this.spawnedTitansHashes.Add(titan.GetHashCode()); titan.resetLevel(size); ModMain.instance.getTaskManager().addLateUpdateTask(new CallRPCsTaks(titan, size, (int)type)); return(titanPrefab); }