private void UnRegisterTrigger() { TriggerManager.DestroyTrigger(this.ChangePlayerTrigger); TriggerManager.DestroyTrigger(this.RestarTrigger); this.ChangePlayerTrigger = null; this.RestarTrigger = null; }
private void UniRegisterBuffTrigger() { TriggerManager.DestroyTrigger(this.AddbuffTrigger); this.AddbuffTrigger = null; TriggerManager.DestroyTrigger(this.RemovebuffTrigger); this.RemovebuffTrigger = null; }
private static void TriggerAddCondition(VTrigger trigger, TriggerCondition tc) { if (trigger != null && tc != null && !trigger.func_conditions.Contains(tc)) { trigger.func_conditions.Add(tc); } }
private void UnRegisterListerners() { TriggerManager.DestroyTrigger(this._towerDefendTrigger); TriggerManager.DestroyTrigger(this._heroAvoidenceTrigger); this._towerDefendTrigger = null; this._heroAvoidenceTrigger = null; }
private void RegisterCallbacks() { this.ClearCallbacks(); this._playerDeath = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.OnHeroDead), this.UniqueId); this._playerRebirth = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitRebirthAgain, null, new TriggerAction(this.OnHeroRelive), this.UniqueId); MobaMessageManager.RegistMessage((ClientMsg)25043, new MobaMessageFunc(this.OnHeroEquipChanged)); }
public void StartAchieve() { if (!this._isActive) { return; } AchieveManager._mGameState = GamePhaseState.Phase1; Singleton <TriggerManager> .Instance.SendGameStateEvent(GameEvent.BattlePhase1); Units player = PlayerControlMgr.Instance.GetPlayer(); this._triggerList.Add(TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.KillHero), -1, "Hero")); this._triggerList.Add(TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.KillHero), -1, "Player")); this._triggerList.Add(TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.MonsterKilling), -1, "Monster")); this._triggerList.Add(TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.PlayerDeath), player.unique_id)); this._triggerList.Add(TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.TowerDestroyed), -1, "Building")); Units home = MapManager.Instance.GetHome(TeamType.BL); if (home != null) { this._triggerList.Add(TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.HomeDestroyed), home.unique_id)); } IList <Units> tower = MapManager.Instance.GetTower(TeamType.LM); if (tower != null && tower.Count > 0) { this._triggerList.Add(TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.TowerDestroyed), 0, "Building")); } this._tr1 = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.HeroDeath), -1, "Hero"); this._triggerList.Add(this._tr1); this._tr2 = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.MonsterDeath), -1, "Monster"); this._triggerList.Add(this._tr2); }
public override void Destroy() { this.ChangePlayerTrigger = null; this.m_CoroutineManager.StopAllCoroutine(); this._data.Clear(); base.Destroy(); }
public override void Uninit() { MobaMessageManager.UnRegistMessage((ClientMsg)25038, new MobaMessageFunc(this.OnSpawnFinished)); TriggerManager.DestroyTrigger(this._trigger); this._trigger = null; this._changePlayerCallBacks.Clear(); }
public override void InitTargets() { base.InitTargets(); this.m_Owner.AddSearchingCallback(new Callback(this.OnSearchPath), new Callback(this.OnStopPath)); this.buffSpawnTrigger = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSpawn, null, new TriggerAction(this.SpawnBuffTarget), this.m_Owner.teamType, "BuffItem"); this.buffDespawnTrigger = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDespawn, null, new TriggerAction(this.DespawnBuffTarget), this.m_Owner.teamType, "BuffItem"); }
private static void TriggerAddAction(VTrigger trigger, TriggerAction ta) { if (trigger != null && ta != null && !trigger.func_actions.Contains(ta)) { trigger.func_actions.Add(ta); } }
public override void Init() { base.Init(); Transform transform = this.transform.FindChild("ParentNode"); this.mTweenPos = transform.GetComponent <TweenPosition>(); this.mTime = transform.FindChild("Time/TimeLabel").GetComponent <UILabel>(); this.mTeam1 = transform.FindChild("TeamScore/Team1").GetComponent <UILabel>(); this.mTeam2 = transform.FindChild("TeamScore/Team2").GetComponent <UILabel>(); this.mKill = transform.FindChild("Kill/KillNumLabel").GetComponent <UILabel>(); this.mDeath = transform.FindChild("Death/DeathNumLabel").GetComponent <UILabel>(); this.mAssists = transform.FindChild("Assists/AssistsNumLabel").GetComponent <UILabel>(); this.mBoss = transform.FindChild("Boss/BossNumLabel").GetComponent <UILabel>(); string level_id = LevelManager.m_CurLevel.level_id; SysBattleSceneVo dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(level_id); if (dataById != null) { if (dataById.scene_map_id.Equals("Map21")) { transform.FindChild("TeamScore").gameObject.SetActive(false); transform.FindChild("Kill").gameObject.SetActive(false); transform.FindChild("Death").gameObject.SetActive(false); transform.FindChild("Assists").gameObject.SetActive(false); transform.FindChild("Boss").gameObject.SetActive(false); } else { this.listener = TriggerManager.CreateGameEventTrigger(GameEvent.UpdateView, null, new TriggerAction(this.UpdateGoldView)); } } }
private static void TriggerRemoveAction(VTrigger trigger) { if (trigger != null) { trigger.func_actions.Clear(); } }
private void doTriggerAction(VTrigger t) { if (t != null && t.CheckConditions()) { t.DoActions(); } }
private static VTrigger CreateTrigger(TriggerType type) { int num = TriggerManager.assign_trigger_id(); VTrigger vTrigger = null; switch (type) { case TriggerType.GameTrigger: vTrigger = new GameTrigger(num); break; case TriggerType.UnitTrigger: vTrigger = new UnitTrigger(num); break; case TriggerType.TimerTrigger: vTrigger = new TimerTrigger(num); break; } if (vTrigger != null) { if (!TriggerManager.triggers.ContainsKey(num)) { TriggerManager.triggers.Add(num, vTrigger); } else { TriggerManager.triggers[num] = vTrigger; } } return(vTrigger); }
private static void TriggerRemoveEvent(VTrigger trigger) { if (trigger != null) { TriggerType trigger_type = (TriggerType)trigger.trigger_type; int trigger_event = trigger.trigger_event; switch (trigger_type) { case TriggerType.GameTrigger: if (TriggerManager.game_callbacks.ContainsKey(trigger_event) && TriggerManager.game_callbacks[trigger_event] != null) { TriggerManager.game_callbacks[trigger_event].Remove((GameTrigger)trigger); } break; case TriggerType.UnitTrigger: if (TriggerManager.character_callbacks.ContainsKey(trigger_event) && TriggerManager.character_callbacks[trigger_event] != null) { TriggerManager.character_callbacks[trigger_event].Remove((UnitTrigger)trigger); } break; case TriggerType.TimerTrigger: TriggerManager.timer_callbacks.Remove((TimerTrigger)trigger); break; } } }
private void RegistgerBuffTrigger(Units player) { if (player != null) { this.AddbuffTrigger = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitAddBuff, null, new TriggerAction(this.UpdateBuffView), player.unique_id); this.RemovebuffTrigger = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitRemoveBuff, null, new TriggerAction(this.UpdateBuffView), player.unique_id); } }
public override void HandleBeforeCloseModule() { this.listener = null; this.mTimeTask = null; this.cMgr.StopAllCoroutine(); MobaMessageManager.UnRegistMessage((ClientMsg)25038, new MobaMessageFunc(this.DoWhenSpawnFinished)); MobaMessageManager.UnRegistMessage((ClientMsg)25035, new MobaMessageFunc(this.DoUnitDead)); }
public override void OnInit() { this.m_preloadCmdMove = new CmdMove(); this.m_preloadCmdSkill = new CmdSkill(); this.m_cmdRunningController = this.self.mCmdRunningController; VTrigger item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.OnUnitDeath), this.self.unique_id); this.listTrigger.Add(item); }
public static void DestroyTrigger(VTrigger trigger) { if (trigger != null && TriggerManager.triggers.ContainsKey(trigger.trigger_id)) { TriggerManager.TriggerRemoveAction(trigger); TriggerManager.TriggerRemoveCondition(trigger); TriggerManager.TriggerRemoveEvent(trigger); TriggerManager.triggers.Remove(trigger.trigger_id); } }
public override void Destroy() { base.Destroy(); this.cMgr.StopAllCoroutine(); if (this.mFriendListen != null) { TriggerManager.DestroyTrigger(this.mFriendListen); this.mFriendListen = null; } }
protected override void StartHighEff() { this.isRebirth = false; this.rebirthTrigger = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitRebirth, null, new TriggerAction(this.doReBirth), this.targetUnit.unique_id); this.targetUnit.CanRebirth.Add(); if (this.skill != null && !this.skill.IsCDTimeOver) { this.skill.StartCDTime(-1f, false); } }
public override void Init() { base.Init(); this.mGrid = this.transform.FindChild("ParentRoot/Grid").GetComponent <UIGrid>(); this.mEnemyCache = this.transform.FindChild("EnemyCache").gameObject; this.mFriendListen = TriggerManager.CreateGameEventTrigger(GameEvent.GameStart, null, new TriggerAction(this.ShowFriendsInfo)); this._playerInfoPool = new ObjectRecycler <PlayersInfoItem>(new Func <PlayersInfoItem>(this.CreatePlayerInfo), delegate(PlayersInfoItem x) { UnityEngine.Object.Destroy(x.gameObject); }); }
public static void DestroyTrigger(int trigger_id) { if (TriggerManager.triggers.ContainsKey(trigger_id)) { VTrigger vTrigger = TriggerManager.triggers[trigger_id]; TriggerManager.TriggerRemoveAction(vTrigger); TriggerManager.TriggerRemoveCondition(vTrigger); TriggerManager.TriggerRemoveEvent(vTrigger); TriggerManager.triggers.Remove(vTrigger.trigger_id); } }
private void OnHeroSpawned(Units hero, EntityVo entityVo) { if (hero != null) { VTrigger item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.RespawnHero), hero.unique_id); this._respawnTriggers.Add(item); } if (this._onSpawnAction != null) { this._onSpawnAction(hero, entityVo); } }
public override void OnInit() { base.OnInit(); VTrigger item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSkillOver, null, new TriggerAction(this.OnSkillOver), this.self.unique_id); this.listTrigger.Add(item); item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSkillFailed, null, new TriggerAction(this.OnSkillFailed), this.self.unique_id); this.listTrigger.Add(item); item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.OnUnitDeath), this.self.unique_id); this.listTrigger.Add(item); this.self.ClearBornPowerObjSkillData(); }
public static void DestroyTriggers(TriggerType type) { Dictionary <int, VTrigger> .Enumerator enumerator = TriggerManager.triggers.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <int, VTrigger> current = enumerator.Current; VTrigger value = current.Value; if (value != null && value.trigger_type == (int)type) { TriggerManager.DestroyTrigger(value); } } }
public void RegisterPlayerEvent() { Units player = PlayerControlMgr.Instance.GetPlayer(); this._watchTarget = player; this.ReSetMiniMapTapEvent(); if (player != null) { this.deathTrigger = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.PlayerDeath), player.unique_id); TriggerManager.CreateGameEventTrigger(GameEvent.ChangePlayer, null, new TriggerAction(this.ChangePlayer)); } this.SetRoleObj(player, true); }
public override void OnInit() { base.OnInit(); VTrigger item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSkillCmdShowPointer, null, new TriggerAction(this.OnShowPointer), this.self.unique_id); this.listTrigger.Add(item); item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSkillCmdHidePointer, null, new TriggerAction(this.OnHidePointer), this.self.unique_id); this.listTrigger.Add(item); item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSkillCmdDragPointer, null, new TriggerAction(this.OnDragPointer), this.self.unique_id); this.listTrigger.Add(item); item = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitSkillControlReset, null, new TriggerAction(this.OnReset), this.self.unique_id); this.listTrigger.Add(item); }
private static void DestroyAllTriggers() { Dictionary <int, VTrigger> .Enumerator enumerator = TriggerManager.triggers.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <int, VTrigger> current = enumerator.Current; VTrigger value = current.Value; if (value != null) { TriggerManager.DestroyTrigger(value); } } }
private void ClearCallbacks() { if (this._playerDeath != null) { TriggerManager.DestroyTrigger(this._playerDeath); } if (this._playerRebirth != null) { TriggerManager.DestroyTrigger(this._playerRebirth); } MobaMessageManager.UnRegistMessage((ClientMsg)25043, new MobaMessageFunc(this.OnHeroEquipChanged)); this._playerRebirth = null; this._playerDeath = null; }