/// <summary> /// Constructor /// </summary> /// <param name="channel">Data used to filter commands from the slave.</param> /// <param name="stateName">The State the slave brain should enter in.</param> /// <param name="target">The brain target, if any.</param> /// <param name="master">The sending gameObject.</param> public ChangeAIBrainStateCommandEvent(StateCommandChannel channel, string stateName, Transform target, GameObject master = null) { Channel = channel; StateName = stateName; Target = target; Master = master; }
/// <summary> /// We broadcast a notification to all AIBrain Slaves /// </summary> /// <param name="channel">An id used to filter messages</param> /// <param name="newStateName">The state the brain should transition to</param> /// <param name="target">The brain target (if any)</param> public virtual void SendCommand(StateCommandChannel channel, string newStateName, Transform target = null) { var evt = new ChangeAIBrainStateCommandEvent(channel, newStateName, target, gameObject); MMEventManager.TriggerEvent(evt); PlayAbilityFeedbacks(); }