private void Start() { //创建Trigger实例,传入技能的发动者 trigger = new TInstantIdea(this.GetUnitReceiver(this)); //注册Trigger进消息中心 MsgDispatcher.RegisterMsg(trigger, "Ponder"); }
private void Start() { //创建Trigger实例,传入技能的发动者 trigger = new TRegeneration(GetComponent <GameUnit.GameUnit>().GetMsgReceiver()); //注册Trigger进消息中心 MsgDispatcher.RegisterMsg(trigger, "Regeneration"); }
private void Start() { // 注册函数响应抽牌信息 MsgDispatcher.RegisterMsg( this.GetMsgReceiver(), (int)MessageType.DrawCard, canDoExtractAction, () => { ExtractCards(); }, "Extract cards Trigger" ); // 注册函数响应回合结束信息 MsgDispatcher.RegisterMsg( this.GetMsgReceiver(), (int)MessageType.EP, canDoCoolDownAction, HandleCooldownEvent, "Cooldown cards Trigger" ); MsgDispatcher.RegisterMsg( this.GetMsgReceiver(), (int)MessageType.Dead, canSendToCoolDownList, HandleCardOnMapToCooldown, "Map Unit cooldown Trigger" ); ExtractCards(3); }
private void Start() { //创建Trigger实例,传入技能的发动者 trigger = new TCourage(this.GetCardReceiver(this)); //注册Trigger进消息中心 MsgDispatcher.RegisterMsg(trigger, "Courage"); }
private void AddListener() { MsgDispatcher.RegisterMsg((int)ROOM_REPLY.ActorAddReply, OnActorAddReply); MsgDispatcher.RegisterMsg((int)ROOM_REPLY.ActorRemoveReply, OnActorRemoveReply); MsgDispatcher.RegisterMsg((int)ROOM_REPLY.ActorMoveReply, OnActorMoveReply); MsgDispatcher.RegisterMsg((int)ROOM_REPLY.CityAddReply, OnCityAddReply); MsgDispatcher.RegisterMsg((int)ROOM_REPLY.CityRemoveReply, OnCityRemoveReply); }
private void AddListener() { MsgDispatcher.RegisterMsg((int)ROOM_REPLY.ActorAiStateHighReply, OnActorAiStateHighReply); MsgDispatcher.RegisterMsg((int)ROOM_REPLY.UpdateActorInfoReply, OnUpdateActorInfoReply); MsgDispatcher.RegisterMsg((int)ROOM_REPLY.FightStartReply, OnFightStartReply); MsgDispatcher.RegisterMsg((int)ROOM_REPLY.FightStopReply, OnFightStopReply); MsgDispatcher.RegisterMsg((int)ROOM_REPLY.AmmoSupplyReply, OnAmmoSupplyReply); MsgDispatcher.RegisterMsg((int)ROOM_REPLY.TryCommandReply, OnTryCommandReply); }
private void Start() { //获得这个技能的持有者,并修改其护甲恢复值 GetComponent <GameUnit.GameUnit>().armorRestore = armor; //创建Trigger实例,传入技能的发动者和护甲恢复值 trigger = new TArmor(GetComponent <GameUnit.GameUnit>().GetMsgReceiver()); //注册Trigger进消息中心 MsgDispatcher.RegisterMsg(trigger, "Armor"); }
private void Start() { //创建Trigger实例 triggerMove = new TMoveStrike(GetComponent <GameUnit>().GetMsgReceiver(), this); triggerAFMove = new TAFMoveStrike(GetComponent <GameUnit>().GetMsgReceiver(), this); //注册Trigger进消息中心 MsgDispatcher.RegisterMsg(triggerMove, "Move"); MsgDispatcher.RegisterMsg(triggerAFMove, "AFMove"); }
private void Start() { arrowrRain = AbilityDatabase.GetInstance().GetAbilityFormat("Arrowrain"); range = (int)arrowrRain.AbilityVariable.Range; damage = (int)arrowrRain.AbilityVariable.Damage; //创建Trigger实例,传入技能的发动者 trigger = new TArrowrain(this.GetCardReceiver(this)); //注册Trigger进消息中心 MsgDispatcher.RegisterMsg(trigger, "Arrowrains"); }
void OnEnable() { MsgDispatcher.RegisterMsg((int)ROOM_REPLY.ActorAiStateReply, OnActorAiStateReply); MsgDispatcher.RegisterMsg((int)ROOM_REPLY.HarvestStartReply, OnHarvestStartReply); MsgDispatcher.RegisterMsg((int)ROOM_REPLY.HarvestStopReply, OnHarvestStopReply); MsgDispatcher.RegisterMsg((int)ROOM_REPLY.FightStartReply, OnFightStartReply); MsgDispatcher.RegisterMsg((int)ROOM_REPLY.FightStopReply, OnFightStopReply); MsgDispatcher.RegisterMsg((int)ROOM_REPLY.SprayBloodReply, OnSprayBloodReply); MsgDispatcher.RegisterMsg((int)ROOM_REPLY.UpdateActorInfoReply, OnUpdateActorInfoReply); MsgDispatcher.RegisterMsg((int)ROOM_REPLY.ActorPlayAniReply, OnActorPlayAniReply); MsgDispatcher.RegisterMsg((int)ROOM_REPLY.AmmoSupplyReply, OnAmmoSupplyReply); MsgDispatcher.RegisterMsg((int)ROOM_REPLY.TryCommandReply, OnTryCommandReply); }
private void Start() { InitAp(); // 注册恢复AP值的函数 MsgDispatcher.RegisterMsg( this.GetMsgReceiver(), (int)MessageType.UpdateSource, canDoAction, ReCalculateAp, "RestoreAP Trigger" ); }
private void Start() { _battleAreaDictionary = BattleMap.BattleMap.Instance().battleArea.BattleAreaDic; MsgDispatcher.RegisterMsg( this.GetMsgReceiver(), (int)MessageType.Dead, NeedToDoJudge, CountEnemyControllingArea, "Game Judge CBA trigger" ); MsgDispatcher.RegisterMsg( this.GetMsgReceiver(), (int)MessageType.Encounter, InEncounter, EncounterJudge, "Encounter Game Judge CBA trigger" ); }
private void Start() { InitMap(); MsgDispatcher.RegisterMsg( this.GetMsgReceiver(), (int)MessageType.MPBegin, canDoMPAction, MpBegin, "Mp Begin Trigger" ); MsgDispatcher.RegisterMsg( this.GetMsgReceiver(), (int)MessageType.MPEnd, canDoMPEndAction, MpEnd, "Mp End Trigger" ); }
public void AddListener() { MsgDispatcher.RegisterMsg((int)ROOM.CityAdd, OnCityAdd); MsgDispatcher.RegisterMsg((int)ROOM.CityRemove, OnCityRemove); MsgDispatcher.RegisterMsg((int)ROOM.ActorAdd, OnActorAdd); MsgDispatcher.RegisterMsg((int)ROOM.ActorRemove, OnActorRemove); MsgDispatcher.RegisterMsg((int)ROOM.ActorMove, OnActorMove); MsgDispatcher.RegisterMsg((int)ROOM.ActorAiState, OnActorAiState); MsgDispatcher.RegisterMsg((int)ROOM.ActorAiStateHigh, OnActorAiStateHigh); MsgDispatcher.RegisterMsg((int)ROOM.UpdateActorPos, OnUpdateActorPos); MsgDispatcher.RegisterMsg((int)ROOM.ActorPlayAni, OnActorPlayAni); MsgDispatcher.RegisterMsg((int)ROOM.TryCommand, OnTryCommand); MsgDispatcher.RegisterMsg((int)ROOM.HarvestStart, OnHarvestStart); MsgDispatcher.RegisterMsg((int)ROOM.HarvestStop, OnHarvestStop); MsgDispatcher.RegisterMsg((int)ROOM.UpdateRes, OnUpdateRes); MsgDispatcher.RegisterMsg((int)ROOM.UpdateActionPoint, OnUpdateActionPoint); MsgDispatcher.RegisterMsg((int)ROOM.FightStart, OnFightStart); MsgDispatcher.RegisterMsg((int)ROOM.FightStop, OnFightStop); }
/// <summary> /// 注册遭遇战胜负判断消息 /// </summary> public void EncounterJudge() { MsgDispatcher.RegisterMsg( this.GetMsgReceiver(), (int)MessageType.Dead, NeedToDoJudge, KillSpecifyUnit, "Game Judge KillUnit trigger" ); MsgDispatcher.RegisterMsg( this.GetMsgReceiver(), (int)MessageType.RoundsEnd, NeedToDoJudge, ProtectArea, "Game Judge ProtectArea trigger" ); MsgDispatcher.RegisterMsg( this.GetMsgReceiver(), (int)MessageType.Aftermove, NeedToDoJudge, EscortUnitToArea, "Game Judge ProtectUnitToArea trigger" ); }
// Use this for initialization void Start() { #region 处理其他UI _battleMapBlockAndUnits = GameObject.Find("MainPanel"); _roundStateText = GameObject.Find("phaseNameText"); _uiToHide = new List <GameObject>(); _uiToHide.Add(_battleMapBlockAndUnits); _uiToHide.Add(_roundStateText); #endregion #region 获取卡牌管理器上相应列表引用 handcardList = CardManager.Instance().cardsInHand; cardSetsList = CardManager.Instance().cardsSets; cooldownList = CardManager.Instance().cooldownCards; handcardInstanceList = CardManager.Instance().handcardsInstance; #endregion // 卡牌书界面内关闭按钮事件监听 _closeWindowButton.onClick.Add(ShowCardBook); // 回合结束按钮添加事件监听 _endRoundButton.onClick.Add(Gameplay.Instance().switchPhaseHandler); // 卡牌堆按钮添加事件监听 _cardSetsButton.onClick.Add(ShowCardBook); _handcardList.childrenRenderOrder = ChildrenRenderOrder.Arch; MsgDispatcher.RegisterMsg( this.GetMsgReceiver(), (int)MessageType.HandcardChange, () => { return(true); }, UpdateHandcards, "Hand cards observer" ); MsgDispatcher.RegisterMsg( this.GetMsgReceiver(), (int)MessageType.CardsetChange, () => { return(true); }, UpdateCardsSets, "Card sets observer" ); MsgDispatcher.RegisterMsg( this.GetMsgReceiver(), (int)MessageType.CooldownlistChange, () => { return(true); }, UpdateCooldownList, "Cooldown list observer" ); UpdateHandcards(); UpdateCardsSets(); UpdateCooldownList(); _handcardList.onClickItem.Add(OnClickHandCard); _cardsSetsList.onClickItem.Add(OnClickCardInCardSets); }
private void Start() { trigger = new THaste(GetComponent <GameUnit.GameUnit>().GetMsgReceiver()); MsgDispatcher.RegisterMsg(trigger, "Haste"); }
void AddListener() { MsgDispatcher.RegisterMsg((int)ROOM_REPLY.UpdateResReply, OnUpdateResReply); MsgDispatcher.RegisterMsg((int)ROOM_REPLY.UpdateActionPointReply, OnUpdateActionPointReply); }
public void Init(RoomLogic roomLogic) { _roomLogic = roomLogic; MsgDispatcher.RegisterMsg((int)ROOM.AmmoSupply, OnAmmoSupply); }