private void OnEnable() { EventPool.StartListening(EventTypes.Move, Move); EventPool.StartListening <Transform>(EventTypes.MoveTo, MoveTo); EventPool.StartListening <bool>(EventTypes.ActionNoTarget, NoTargetAction); EventPool.StartListening <ActionType, UnitController>(EventTypes.ActionEnemyTarget, TargetEnemy); EventPool.StartListening <ActionType, UnitController>(EventTypes.ActionFriendlyTarget, TargetFriend); EventPool.StartListening <ActionType, AvatarController>(EventTypes.ActionFriendlyTargetAvatar, TargetFriend); EventPool.StartListening(EventTypes.Cancel, CancelAction); EventPool.StartListening <UnitController>(EventTypes.Targeted, ExecuteTargetingAction); EventPool.StartListening <UnitController>(EventTypes.UnitDeath, RemoveUnit); InfoPool.Provide("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 OnEnable() { EventPool.StartListening <string>(EventTypes.ActionTipSet, SetTip); EventPool.StartListening(EventTypes.ActionTipReset, ResetTip); }
void OnEnable() { EventPool.StartListening <string, string>(EventTypes.MessageArrived, NewMessageArrived); InfoPool.Provide("unread_messages", GetUnreadMessages); }