Ejemplo n.º 1
0
        /// <summary>
        /// The main interface for communicating between behaviours.  Using polymorphism, we
        /// define a bunch of different messages deriving from BehaviourMessage.  Each behaviour
        /// can then check for particular upcasted messahe types, and either grab some data
        /// from it (set message) or store some data in it (get message).
        /// </summary>
        /// <param name="msg">The message being communicated to the behaviour.</param>
        public override void OnMessage(ref BehaviourMessage msg)
        {
            if (msg is SetLookTargetMessage)
            {
                SetLookTargetMessage temp = (SetLookTargetMessage)msg;

                mTarget = temp.mTarget_In;
            }
            else if (msg is Health.OnZeroHealthMessage)
            {
                mParentGOH.SetBehaviourEnabled <FaceForward>(false);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Put message back into a default state.
 /// </summary>
 public override void Reset()
 {
     mTarget_In = null;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// The main interface for communicating between behaviours.  Using polymorphism, we
        /// define a bunch of different messages deriving from BehaviourMessage.  Each behaviour
        /// can then check for particular upcasted messahe types, and either grab some data 
        /// from it (set message) or store some data in it (get message).
        /// </summary>
        /// <param name="msg">The message being communicated to the behaviour.</param>
        public override void OnMessage(ref BehaviourMessage msg)
        {
            if (msg is SetLookTargetMessage)
            {
                SetLookTargetMessage temp = (SetLookTargetMessage)msg;

                mTarget = temp.mTarget_In;
            }
            else if (msg is Health.OnZeroHealthMessage)
            {
                mParentGOH.SetBehaviourEnabled<FaceForward>(false);
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Put message back into a default state.
 /// </summary>
 public override void Reset()
 {
     mTarget_In = null;
 }