protected override void OnOpen() { infoActiveGO.SetActive(false); #if false //cheat Weapon.UnlockWeapon(1); Weapon.UnlockWeapon(2); Weapon.UnlockWeapon(3); Weapon.UnlockWeapon(4); Weapon.UnlockWeapon(5); Weapon.UnlockWeapon(6); for (int i = 0; i < mLevelItems.Length; i++) { if (!string.IsNullOrEmpty(mLevelItems[i].level)) { SceneState.instance.SetGlobalValue(mLevelItems[i].level, 1, true); mLevelItems[i].Init(); } } #endif mLockInput = false; //check if we need to play boss intro bool initFinalLevelItem = true; if (UserData.instance.GetInt(levelSelectBossIntroUDKey, 0) == 0) { int completeCount = 0; for (int i = 0; i < mLevelItems.Length; i++) { if (mLevelItems[i] != finalLevel && mLevelItems[i] != gitgirl && mLevelItems[i].isCompleted) { completeCount++; } } if (completeCount == mLevelItems.Length - 2) { mLockInput = true; UserData.instance.SetInt(levelSelectBossIntroUDKey, 1); bossAlertAnimDat.Play("go"); //animator will re-open this modal after the intro initFinalLevelItem = false; } } if (initFinalLevelItem) { finalLevel.InitFinalLevel(mLevelItems, gitgirl); } //reset some data Weapon.ResetWeaponEnergies(); }
void Awake() { mLevelItems = GetComponentsInChildren <UILevelSelectItem>(true); //init items foreach (UILevelSelectItem item in mLevelItems) { if (item.gameObject.activeSelf) { item.Init(); } } finalLevel.InitFinalLevel(mLevelItems); }