/// <summary> /// 在倒计时时间内直接出兵,战斗开始 /// </summary> /// <param name="eventType"></param> /// <param name="obj"></param> private void OnFightRealBegin(string eventType, object obj) { EventDispather.RemoveEventListener(GameEvents.BATTLE_SPAWN, OnFightRealBegin); EventDispather.DispatherEvent(BACK_TIME_FIGHT_START); GameObject backTimeWin = UIMananger.Instance.ShowWin("PLG_Fight", "UIFightBackTimePanel"); UISprite sprite = backTimeWin.GetComponent <UISprite>(); PanelUtil.SetPanelAnchors(sprite, UIMananger.Instance.uiLayer.transform, new Vector4(0.5f, 0.5f, 1, 1), new Vector4(-sprite.width * 0.5f, sprite.width * 0.5f, -sprite.height, 0)); backTimeWin.GetComponent <UIFightBackTimeWnd>().SetTimeAndType(2, 180); }
public override void Destroy() { if (gatherIcon != null) { gatherIcon.GetComponent <CollectResIconUI>().OnClickEvent -= GatherResource; GameObject.Destroy(gatherIcon); gatherIcon = null; } EventDispather.RemoveEventListener(GameEvents.RESOURCE_CHANGE, OnResourceChange); base.Destroy(); }
private void OnFightRealEnd(string eventType, object obj) { EventDispather.RemoveEventListener(GameEvents.BATTLE_END, OnFightRealEnd); UIMananger.Instance.CloseWin("UIFightBackTimePanel"); UIMananger.Instance.CloseWin("UIFightReplayBackTimePanel"); if (GameWorld.Instance.worldType == WorldType.Battle) { DelayManager.Instance.AddDelayCall(ShowFightResultWin, 1.2f); } else if (GameWorld.Instance.worldType == WorldType.Replay) { DelayManager.Instance.AddDelayCall(ShowFightReplayResultWin, 1.2f); } }
public void BackTimeOver(int type) { if (BACK_TIME_FIGHT_PREPARE == type) { //战斗准备期结束 GameObject backTimeWin = UIMananger.Instance.ShowWin("PLG_Fight", "UIFightBackTimePanel"); UISprite sprite = backTimeWin.GetComponent <UISprite>(); PanelUtil.SetPanelAnchors(sprite, UIMananger.Instance.uiLayer.transform, new Vector4(0.5f, 0.5f, 1, 1), new Vector4(-sprite.width * 0.5f, sprite.width * 0.5f, -sprite.height, 0)); backTimeWin.GetComponent <UIFightBackTimeWnd>().SetTimeAndType(2, 180); EventDispather.DispatherEvent(BACK_TIME_FIGHT_START); //战斗默认开始了 BattleManager.Instance.StartBattle(); //倒计时正常结束,不需要监听本事件 EventDispather.RemoveEventListener(GameEvents.BATTLE_SPAWN, OnFightRealBegin); } else if (BACK_TIME_FIGHT_OVER == type) { //战斗结束 UIMananger.Instance.CloseWin("UIBackTimePanel"); BattleManager.Instance.ForceBattleEnd(); ShowFightResultWin(); } }
public override void Destroy() { EventDispather.RemoveEventListener(GameEvents.TRAP_REFILL, OnTrapRefill); base.Destroy(); }
public override void Destroy() { EventDispather.RemoveEventListener(GameEvents.SKILL_UP, OnSkillUpEvent); base.Destroy(); }