public StageSceneBalanceComponent(StageScene scene) { mScene = scene; mRes = mScene.GetStageRes(); EventSystem.Instance.addEventListener(StageEndUIEvent.STAGE_END_FINISH, OnStageEndFinish); }
public StageSceneReliveComponent(StageScene scene) { mScene = scene; mRes = mScene.GetStageRes(); EventSystem.Instance.addEventListener(StageReliveEvent.STAGE_RELIVE_REQUEST, onReliveRequest); EventSystem.Instance.addEventListener(StageReliveEvent.STAGE_RELIVE_RESPOND, onReliveRespond); }
public ActiveSceneBalanceComponent(StageScene scene) { mScene = scene; mRes = mScene.GetStageRes(); EventSystem.Instance.addEventListener(StageEndUIEvent.STAGE_END_FINISH, onGameOver); Init(); }
// 初始化数据 private void Init() { BaseScene scene = SceneManager.Instance.GetCurScene(); if (scene == null) { return; } if (!typeof(StageScene).IsAssignableFrom(scene.GetType())) { return; } StageScene stage = scene as StageScene; mRes = stage.GetStageRes(); if (mRes == null) { return; } if (mModule == null) { mModule = ModuleManager.Instance.FindModule <StageBalanceModule>(); } mOKBtn.SetActive(false); mNormalPanel.SetActive(false); mExtraPanel.SetActive(false); mAwardPanel.SetActive(false); mExtraAwardPanel.SetActive(false); mNormalEffectUI.Stop(); mExtraEffectUI.Stop(); // 不显示普通翻牌 if (mRes.mRandomAwardTimes < 1 || mRes.mRandomAwardBoxId < 0) { mLeftAwardTimes = 0; mState = UIState.STATE_3; } else { mNormalPanel.SetActive(true); mLeftAwardTimes = mRes.mRandomAwardTimes; mState = UIState.STATE_0; } mNormalTimesLabel1.text = GetCardTypeText(mRes.mRandomAwardCostId); foreach (StageBalanceItemUI item in mItemNormalList) { item.SetCostId(mRes.mRandomAwardCostId); item.AddListener(); } UpdateAwardTimes(); //RandomAward(); // 不显示钻石翻牌 if (mRes.mExtraAwardTimes < 1 || mRes.mExtraAwardBoxId < 0) { mLeftExtraAwardTimes = 0; if (mState == UIState.STATE_3) { mState = UIState.STATE_DESTROY; mOKBtn.SetActive(true); } } else { mLeftExtraAwardTimes = mRes.mExtraAwardTimes; } mExtraTimesLabel1.text = GetCardTypeText(mRes.mExtraAwardCostId); foreach (StageBalanceItemUI item in mItemExtraList) { item.SetCostId(mRes.mExtraAwardCostId); item.AddListener(); } UpdateExtraAwardTimes(); //RandomExtraAward(); }