private void OnDisable() { EventPool.StopListening(EventTypes.Move, Move); EventPool.StopListening <Transform>(EventTypes.MoveTo, MoveTo); EventPool.StopListening <bool>(EventTypes.ActionNoTarget, NoTargetAction); EventPool.StopListening <ActionType, UnitController>(EventTypes.ActionEnemyTarget, TargetEnemy); EventPool.StopListening <ActionType, UnitController>(EventTypes.ActionFriendlyTarget, TargetFriend); EventPool.StopListening <ActionType, AvatarController>(EventTypes.ActionFriendlyTargetAvatar, TargetFriend); EventPool.StopListening(EventTypes.Cancel, CancelAction); EventPool.StopListening <UnitController>(EventTypes.Targeted, ExecuteTargetingAction); EventPool.StopListening <UnitController>(EventTypes.UnitDeath, RemoveUnit); InfoPool.Unprovide("Battlefield units", GetBattlefieldUnits); }
protected override void Start() { base.Start(); UnityAction oldAction = Action; Action = delegate { oldAction(); EventPool.StartListening <UnitController>(EventTypes.Targeted, Target); }; Target = delegate(UnitController unitController) { DefaultTarget(unitController); EventPool.StopListening <UnitController>(EventTypes.Targeted, Target); }; }
private void OnDisable() { EventPool.StopListening <string>(EventTypes.ActionTipSet, SetTip); EventPool.StopListening(EventTypes.ActionTipReset, ResetTip); }
void OnDisable() { EventPool.StopListening <string, string>(EventTypes.MessageArrived, NewMessageArrived); InfoPool.Unprovide("unread_messages", GetUnreadMessages); }