Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
    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);
        };
    }
Ejemplo n.º 3
0
 private void OnDisable()
 {
     EventPool.StopListening <string>(EventTypes.ActionTipSet, SetTip);
     EventPool.StopListening(EventTypes.ActionTipReset, ResetTip);
 }
Ejemplo n.º 4
0
 void OnDisable()
 {
     EventPool.StopListening <string, string>(EventTypes.MessageArrived, NewMessageArrived);
     InfoPool.Unprovide("unread_messages", GetUnreadMessages);
 }