Exemplo n.º 1
0
        /// <summary>
        /// Send messages to all scripts with IBehaviourListener to this animator
        /// </summary>
        void DeliverListener(MesssageItem m, IAnimatorListener listener)
        {
            switch (m.typeM)
            {
            case TypeMessage.Bool:
                listener.OnAnimatorBehaviourMessage(m.message, m.boolValue);
                break;

            case TypeMessage.Int:
                listener.OnAnimatorBehaviourMessage(m.message, m.intValue);
                break;

            case TypeMessage.Float:
                listener.OnAnimatorBehaviourMessage(m.message, m.floatValue);
                break;

            case TypeMessage.String:
                listener.OnAnimatorBehaviourMessage(m.message, m.stringValue);
                break;

            case TypeMessage.Void:
                listener.OnAnimatorBehaviourMessage(m.message, null);
                break;

            default:
                break;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Using Message to the Monovehaviours asociated to this animator delivery with Send Message
        /// </summary>
        void DeliverMessage(MesssageItem m, Animator anim)
        {
            switch (m.typeM)
            {
            case TypeMessage.Bool:
                anim.SendMessage(m.message, m.boolValue, SendMessageOptions.DontRequireReceiver);
                break;

            case TypeMessage.Int:
                anim.SendMessage(m.message, m.intValue, SendMessageOptions.DontRequireReceiver);
                break;

            case TypeMessage.Float:
                anim.SendMessage(m.message, m.floatValue, SendMessageOptions.DontRequireReceiver);
                break;

            case TypeMessage.String:
                anim.SendMessage(m.message, m.stringValue, SendMessageOptions.DontRequireReceiver);
                break;

            case TypeMessage.Void:
                anim.SendMessage(m.message, SendMessageOptions.DontRequireReceiver);

                break;

            default:
                break;
            }
        }
Exemplo n.º 3
0
        /// <summary> Send messages to all scripts with IBehaviourListener to this animator   </summary>
        void DeliverListener(MesssageItem m, IAnimatorListener listener)
        {
            string val       = "";
            bool   succesful = false;

            switch (m.typeM)
            {
            case TypeMessage.Bool:
                succesful = listener.OnAnimatorBehaviourMessage(m.message, m.boolValue);
                val       = m.boolValue.ToString();
                break;

            case TypeMessage.Int:
                succesful = listener.OnAnimatorBehaviourMessage(m.message, m.intValue);
                val       = m.intValue.ToString();
                break;

            case TypeMessage.Float:
                succesful = listener.OnAnimatorBehaviourMessage(m.message, m.floatValue);
                val       = m.floatValue.ToString();
                break;

            case TypeMessage.String:
                succesful = listener.OnAnimatorBehaviourMessage(m.message, m.stringValue);
                val       = m.stringValue.ToString();
                break;

            case TypeMessage.Void:
                succesful = listener.OnAnimatorBehaviourMessage(m.message, null);
                val       = "Void";
                break;

            case TypeMessage.IntVar:
                succesful = listener.OnAnimatorBehaviourMessage(m.message, (int)m.intVarValue);
                val       = m.intVarValue.name.ToString();
                break;

            case TypeMessage.Transform:
                succesful = listener.OnAnimatorBehaviourMessage(m.message, m.transformValue);
                val       = m.transformValue.name.ToString();
                break;

            default:
                break;
            }

            if (debug && succesful)
            {
                Debug.Log($"<b>[Msg: {m.message}->{val}] [{m.typeM}]</b> T:{Time.time:F3}");                      //Debug
            }
        }
Exemplo n.º 4
0
        /// <summary>  Using Message to the Monovehaviours asociated to this animator delivery with Send Message  </summary>
        void DeliverMessage(MesssageItem m, Animator anim)
        {
            switch (m.typeM)
            {
            case TypeMessage.Bool:
                anim.SendMessage(m.message, m.boolValue, SendMessageOptions.DontRequireReceiver);
                break;

            case TypeMessage.Int:
                anim.SendMessage(m.message, m.intValue, SendMessageOptions.DontRequireReceiver);
                break;

            case TypeMessage.Float:
                anim.SendMessage(m.message, m.floatValue, SendMessageOptions.DontRequireReceiver);
                break;

            case TypeMessage.String:
                anim.SendMessage(m.message, m.stringValue, SendMessageOptions.DontRequireReceiver);
                break;

            case TypeMessage.Void:
                anim.SendMessage(m.message, SendMessageOptions.DontRequireReceiver);
                break;

            case TypeMessage.IntVar:
                anim.SendMessage(m.message, (int)m.intVarValue, SendMessageOptions.DontRequireReceiver);
                break;

            case TypeMessage.Transform:
                anim.SendMessage(m.message, m.transformValue, SendMessageOptions.DontRequireReceiver);
                break;

            default:
                break;
            }

            if (debug)
            {
                Debug.Log($"{name}:<color=white> <b>[Msg Behaviour] [Animator:{anim.name}] [Msg:{m.message} | Type: {m.typeM}]</b> </color>");         //Debug
            }
        }