void Start() { Screen.SetResolution(1280, 720, true); charsInRound = new int[] { 1, 1, 1, 1, 1, 4, 4, 4, 4, 4 }; spawner = GameObject.Find("Spawner").GetComponent <C_Spawner>(); foreach (Transform window in GameObject.Find("Window").transform) { NGUITools.SetActive(window.gameObject, false); } if (!SaveController.instance.newGame) { SaveController.instance.prepareLoadedLevel(); } else { boss = Instantiate(BossHolder.instance.boss, bossSpawnPoint, BossHolder.instance.boss.transform.rotation) as GameObject; } talentWindow.GetComponent <TalentWindow>().initialize(); bossC = boss.GetComponent <C_Boss>(); bossM = boss.GetComponent <M_Boss>(); Bottombar.instance.l_bossLabel.text = bossM.eName; InvokeRepeating("increaseGrudge", 5f, 5f); Invoke("startNextDefense", 1f); gameState = (int)GameState.PREPARATION; }
void Start() { s_avatar = transform.Find("Avatar").GetComponent <UISprite>(); s_button = transform.Find("Button").GetComponent <UISprite>(); l_description = transform.Find("Description").GetComponent <UILabel>(); l_button = transform.Find("L_Button").GetComponent <UILabel>(); M_Boss boss = prefab.GetComponent <M_Boss>(); l_description.text = "'" + boss.eDescription + "'"; }
void Start() { boss = GetComponent <M_Boss>(); initialize(); }
void postPrepareLoadedLevel() { cleanLevelForLoad(); M_Boss bossM = GameController.instance.boss.GetComponent <M_Boss>(); bossM.health = savedGame.bossHealth; bossM.mana = savedGame.bossMana; bossM.maxHealth = savedGame.bossMaxHealth; bossM.maxMana = savedGame.bossMaxMana; int i = 0; foreach (M_Mob mob in instantiatedMobs) { mob.health = savedGame.mobs[i][1]; mob.mana = savedGame.mobs[i][2]; mob.maxHealth = savedGame.mobs[i][3]; mob.maxMana = savedGame.mobs[i][4]; i++; } i = 0; foreach (float[] chestAttr in savedGame.chestPos) { GameObject chestPrefab = PrefabIndex.instance.prefabIndex[savedGame.chests[i][0]]; Vector3 chestPos = new Vector3(savedGame.chestPos[i][0], savedGame.chestPos[i][1], savedGame.chestPos[i][2]); GameObject insChest = Instantiate(chestPrefab, chestPos, chestPrefab.transform.rotation) as GameObject; GameController.instance.roomShades[savedGame.chests[i][1]].GetComponent <RoomController>().addChest(insChest); i++; } // Spawn Menu i = 0; while (true) { i++; Transform mobSlot = GameController.instance.mobWindow.transform.Find("Scroller/Grid/Slot" + i); if (mobSlot != null) { ShopSlot sSlot = mobSlot.GetComponent <ShopSlot>(); if (savedGame.spawnSlots[i - 1][0] != 1) { sSlot.unlock(); } if (savedGame.spawnSlots[i - 1][1] == 1) { sSlot.changeButtonToTalent(); } if (savedGame.spawnSlots[i - 1][2] == 1) { sSlot.toggleSelected(); Bottombar.instance.addToBar(PrefabIndex.instance.prefabIndex[savedGame.spawnSlots[i - 1][3]]); } } else { break; } } NGUITools.SetActive(GameController.instance.mobWindow, false); // Talents i = 0; foreach (Talent[] talents in TalentWindow.instance.allTalents) { for (int j = 0; j < 9; j++) { talents[j].active = savedGame.talents[i][j] == 1; } i++; } NGUITools.SetActive(GameController.instance.loadingWindow, false); }