void ResetData() { mMoveState = MoveState.None; rotateTrans.rotation = Quaternion.identity; LevelManager lvlMgr = LevelManager.instance; planetPrev.Play(lvlMgr.prevStageData.planetRef); planetCur.Play(lvlMgr.curStageData.planetRef); planetNext.Play(lvlMgr.nextStageData.planetRef); planetPrev.Sprite.color = lvlMgr.prevStageData.unlocked ? Color.white : lockedColor; planetCur.Sprite.color = lvlMgr.curStageData.unlocked ? Color.white : lockedColor; planetNext.Sprite.color = lvlMgr.nextStageData.unlocked ? Color.white : lockedColor; title.text = lvlMgr.curStageData.title; title.color = lvlMgr.curStageData.unlocked ? Color.white : lockedColor; if (lvlMgr.curStageData.unlocked) { desc.text = lvlMgr.curStageData.desc; } else { desc.text = string.Format(GameLocalize.GetText("stage_locked"), lvlMgr.curStageData.starRequire); } //desc.color = lvlMgr.curStageData.unlocked ? Color.white : lockedColor; NGUILayoutBase.RefreshNow(transform); }
protected override void OnActive(bool active) { if (active) { for (int i = 0; i < data.Length; i++) { data[i].btn.onSelect = OnSelect; data[i].btn.onClick = OnClick; } back.onClick = OnBack; UICamera.selectedObject = data[startIndex].btn.gameObject; infoLabel.text = GameLocalize.GetText(data[startIndex].infoRef); NGUILayoutBase.RefreshNow(transform); } else { for (int i = 0; i < data.Length; i++) { data[i].btn.onSelect = null; data[i].btn.onClick = null; } back.onClick = null; } }
void LateUpdate() { if (mDoLayoutUpdate) { NGUILayoutBase.RefreshNow(transform); mDoLayoutUpdate = false; } }
void OnSelect(GameObject go, bool state) { if (state) { int ind = GetIndex(go); if (ind != -1) { infoLabel.text = GameLocalize.GetText(data[ind].infoRef); NGUILayoutBase.RefreshNow(transform); } } }
protected override void OnOpen() { if (!string.IsNullOrEmpty(sWeaponTitleRef)) { title.text = GameLocalize.GetText(sWeaponTitleRef); desc.text = GameLocalize.GetText(sWeaponTitleRef + "_desc"); } if (!string.IsNullOrEmpty(sWeaponIconRef)) { icon.spriteName = sWeaponIconRef; } NGUILayoutBase.RefreshNow(transform); }
void Init() { Player player = Player.instance; LevelManager.LevelData lvlDat = LevelManager.instance.curLevelData; int newRecords = 0; if (lvlDat.isNewTime) { timeLabel.text = timeLabel.text + "*"; newRecords++; } timeInfoLabel.text = string.Format("{0} : {1}", LevelManager.GetTimeText(player.curTime), lvlDat.parTimeText); if (lvlDat.isNewDeath) { deathLabel.text = deathLabel.text + "*"; } deathInfoLabel.text = player.numDeath > 0 ? player.numDeath.ToString() : "None"; if (lvlDat.isNewStar) { starLabel.text = starLabel.text + "*"; newRecords++; } for (int i = 0; i < player.HUD.starsFilled; i++) { stars[i].spriteName = "star_fill"; } for (int i = player.HUD.starsFilled; i < stars.Length; i++) { stars[i].spriteName = "star_empty"; } newRecordLabel.gameObject.SetActive(newRecords > 0); NGUILayoutBase.RefreshNow(transform); instructionsGO.SetActive(false); }
void DoActive() { RefreshSlots(); HookUpEvents(true); back.onClick = OnBack; if (mSelectedSlot == -1) { mSelectedSlot = 0; } UICamera.selectedObject = slots[mSelectedSlot].exists ? slots[mSelectedSlot].infoGO : slots[mSelectedSlot].newGO; NGUILayoutBase.RefreshNow(transform); mLateRefresh = false; }
protected override void OnOpen() { //save data if best string level = LevelController.levelLoaded; float t = LevelController.timeTrialSaved; float tBest; bool isBest; if (TimeTrial.Exists(level)) { float lastT = TimeTrial.Load(level); if (t < lastT) { tBest = t; isBest = true; //TimeTrial.Save(level, t); } else { tBest = lastT; isBest = false; } } else { tBest = t; isBest = true; //TimeTrial.Save(level, t); } timeLabel.text = LevelController.LevelTimeFormat(t); timeBestLabel.text = LevelController.LevelTimeFormat(tBest); newRecordGO.SetActive(isBest); //post //TimeTrial.Post(level, t); NGUILayoutBase.RefreshNow(transform); }
void Awake() { #if OUYA input.gameObject.SetActive(false); input = null; graphics.gameObject.SetActive(false); graphics = null; UIButtonKeys musicBtnKeys = music.GetComponent <UIButtonKeys>(); UIButtonKeys backBtnKeys = back.GetComponent <UIButtonKeys>(); musicBtnKeys.selectOnUp = backBtnKeys; backBtnKeys.selectOnDown = musicBtnKeys; NGUILayoutBase.RefreshNow(transform); #endif mMusicSlider = music.GetComponent <UISlider>(); mSoundSlider = sound.GetComponent <UISlider>(); }
protected override void OnOpen() { NGUILayoutBase.RefreshNow(transform); }