// 更新显示 public void UpdateUI() { if (mListItem == null) { return; } PlayerDataModule playermodule = ModuleManager.Instance.FindModule <PlayerDataModule>(); if (playermodule == null) { return; } StageListModule module = ModuleManager.Instance.FindModule <StageListModule>(); if (module == null) { return; } bool unlock = false; if (!module.HasNormalLevel(mListItem)) { mStarSlot0.SetActive(false); mStarIcon0.SetActive(false); } else { mStarSlot0.SetActive(true); mStarIcon0.SetActive(playermodule.IsStageHasPassed(mListItem.mNromalStageId)); } if (!module.HasHardLevel(mListItem)) { mStarSlot1.SetActive(false); mStarIcon1.SetActive(false); } else { mStarSlot1.SetActive(true); mStarIcon1.SetActive(playermodule.IsStageHasPassed(mListItem.mHardStageId)); } if (!module.HasSeriousLevel(mListItem)) { mStarSlot2.SetActive(false); mStarIcon2.SetActive(false); } else { mStarSlot2.SetActive(true); mStarIcon2.SetActive(playermodule.IsStageHasPassed(mListItem.mSeriousStageId)); } }
// 显示关卡信息 private void OnStageChanged() { PlayerDataModule module = ModuleManager.Instance.FindModule <PlayerDataModule>(); if (module == null) { return; } mMyFPText.text = module.GetGrade().ToString(); mBestFPText.text = mModule.GetSuitableFC().ToString(); mCostSPText.text = mModule.GetCostSP().ToString(); mExpText.text = mModule.GetAwardExp().ToString(); if (mModule.ShowLevelBar) { bool unlock = false; if (!mModule.HasNormalLevel(mModule.SelectedStageListRes)) { mNormalBtn.SetActive(false); mNormalDisable.SetActive(false); //SetEnergyBarShowType(EnergyBarUI.EnergyBarShowType.ShowSpOnly); SetMoneyBarShowType(MoneyBarType.TiLi); } else { unlock = mPlayerModule.IsStageUnlock(mModule.SelectedStageListRes.mNromalStageId); mNormalBtn.SetActive(unlock); mNormalDisable.SetActive(!unlock); //SetEnergyBarShowType(EnergyBarUI.EnergyBarShowType.All); BetterList <MoneyBarType> list = new BetterList <MoneyBarType>(); list.Add(MoneyBarType.TiLi); list.Add(MoneyBarType.XingXing); SetMoneyBarShowType(list); } if (!mModule.HasHardLevel(mModule.SelectedStageListRes)) { mHardBtn.SetActive(false); mHardDisable.SetActive(false); } else { unlock = mPlayerModule.IsStageUnlock(mModule.SelectedStageListRes.mHardStageId); mHardBtn.SetActive(unlock); mHardDisable.SetActive(!unlock); } if (!mModule.HasSeriousLevel(mModule.SelectedStageListRes)) { mSeriousBtn.SetActive(false); mSeriousDisable.SetActive(false); } else { unlock = mPlayerModule.IsStageUnlock(mModule.SelectedStageListRes.mSeriousStageId); mSeriousBtn.SetActive(unlock); mSeriousDisable.SetActive(!unlock); } for (int i = 0; i < mHoverList.Count; ++i) { mHoverList[i].SetActive(mModule.SelectedLevel == i); } } else { //SetEnergyBarShowType(EnergyBarUI.EnergyBarShowType.ShowSpOnly); SetMoneyBarShowType(MoneyBarType.TiLi); } if (mModule.SelectedUI != null) { mModule.SelectedUI.SetStageRes(mModule.SelectedStageRes); mEnterBtn.SetActive(!mModule.SelectedUI.GetLocked()); } ObjectCommon.DestoryChildren(mFirstPassItem); ObjectCommon.DestoryChildren(mNormalPassItem); if (mModule.SelectedStageRes != null) { mHasAwardedIcon.SetActive(module.IsStageHasPassed(mModule.SelectedStageRes.resID)); if (mModule.SelectedStageRes.mFirstAwardId >= 0) { AwardItemUI awardItemUI = new AwardItemUI(mModule.SelectedStageRes.mFirstAwardId, 1); awardItemUI.gameObject.transform.parent = mFirstPassItem.transform; awardItemUI.gameObject.transform.localPosition = Vector3.zero; awardItemUI.gameObject.transform.localScale = Vector3.one; } if (mModule.SelectedStageRes.mPassAwardId0 >= 0) { AwardItemUI awardItemUI = new AwardItemUI(mModule.SelectedStageRes.mPassAwardId0, 1); awardItemUI.gameObject.transform.parent = mNormalPassItem.transform; awardItemUI.gameObject.transform.localPosition = Vector3.zero; awardItemUI.gameObject.transform.localScale = Vector3.one; } } }