/// <summary> /// 在openUI之后调用 /// </summary> /// <param name="index"></param> /// <param name="notify"></param> public void SetTabIndex(int index, bool notify = true) { mIndex = index; if (!notify) { return; } CropsEvent evt = new CropsEvent(CropsEvent.TAB_INDEX); EventSystem.Instance.PushEvent(evt); }
// 复活答复 private void onMainCropsReliveRespond(EventBase evt) { CropsEvent e = evt as CropsEvent; if (e == null) { return; } Crops mMainCrops = PlayerController.Instance.GetMainCropsControlObj() as Crops; if (mMainCrops == null) { return; } if (mMainCropsReliveTimes < mRes.mCropsReliveTimes) { mMainCrops.Relive((int)mMainCrops.GetMaxHP(), (int)mMainCrops.GetMaxMana()); mMainCropsReliveTimes++; } }
protected override void OnRespond(respond_crops_buy respond, object userdata) { PlayerDataModule module = ModuleManager.Instance.FindModule <PlayerDataModule>(); if (module == null) { return; } if (respond.errorcode != (int)Message.ERROR_CODE.ERR_CROPS_BUY_OK) { // ½øÐдíÎóÌáʾ PopTipManager.Instance.AddNewTip(StringHelper.GetString("crops_buy_failed")); return; } PopTipManager.Instance.AddNewTip(StringHelper.GetString("crops_buy_ok")); CropsEvent evt = new CropsEvent(CropsEvent.BUY_CROPS); EventSystem.Instance.PushEvent(evt); }
protected override void OnRespond(respond_crops_level respond, object userdata) { PlayerDataModule module = ModuleManager.Instance.FindModule <PlayerDataModule>(); if (module == null) { return; } if (respond.errorcode != (int)Message.ERROR_CODE.ERR_CROPS_PROMOTE_OK) { // ½øÐдíÎóÌáʾ PopTipManager.Instance.AddNewTip(StringHelper.GetString("crops_rise_failed")); return; } PopTipManager.Instance.AddNewTip(StringHelper.GetString("crops_rise_ok")); CropsEvent evt = new CropsEvent(CropsEvent.RISE_STARS); EventSystem.Instance.PushEvent(evt); //EventSystem.Instance.PushEvent(new ItemEvent(ItemEvent.UPDATE_CHANGE)); }