Example #1
0
        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;

            case TypeMessage.IntVar:
                listener.OnAnimatorBehaviourMessage(m.message, (int)m.intVarValue);
                break;

            default:
                break;
            }
        }
Example #2
0
        void DeliverMessage(MesssageItem m, Component component)
        {
            switch (m.typeM)
            {
            case TypeMessage.Bool:
                component.SendMessage(m.message, m.boolValue, SendMessageOptions.DontRequireReceiver);
                break;

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

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

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

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

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

            default:
                break;
            }
        }
Example #3
0
 private void Deliver(MesssageItem m, Component component)
 {
     if (UseSendMessage)
     {
         DeliverMessage(m, component.transform.root);
     }
     else
     {
         IAnimatorListener liste = component.GetComponentInParent <IAnimatorListener>();
         if (liste != null)
         {
             DeliverListener(m, liste);
         }
     }
 }
Example #4
0
 private void Deliver(MesssageItem m, GameObject component)
 {
     if (UseSendMessage)
     {
         DeliverMessage(m, component.transform.root.gameObject);
     }
     else
     {
         var listeners = component.transform.root.GetComponentsInChildren <IAnimatorListener>();
         if (listeners != null && listeners.Length > 0)
         {
             foreach (var list in listeners)
             {
                 DeliverListener(m, list);
             }
         }
     }
 }
Example #5
0
        public static void DeliverMessage(MesssageItem m, GameObject component)
        {
            switch (m.typeM)
            {
            case TypeMessage.Bool:
                component.SendMessage(m.message, m.boolValue, SendMessageOptions.DontRequireReceiver);
                break;

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

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

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

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

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

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

            case TypeMessage.GameObject:
                component.SendMessage(m.message, m.GoValue, SendMessageOptions.DontRequireReceiver);
                break;

            case TypeMessage.Component:
                component.SendMessage(m.message, m.ComponentValue, SendMessageOptions.DontRequireReceiver);
                break;

            default:
                break;
            }
        }
Example #6
0
        public static 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;

            case TypeMessage.IntVar:
                listener.OnAnimatorBehaviourMessage(m.message, (int)m.intVarValue);
                break;

            case TypeMessage.Transform:
                listener.OnAnimatorBehaviourMessage(m.message, m.transformValue);
                break;

            case TypeMessage.GameObject:
                listener.OnAnimatorBehaviourMessage(m.message, m.GoValue);
                break;

            case TypeMessage.Component:
                listener.OnAnimatorBehaviourMessage(m.message, m.ComponentValue);
                break;

            default:
                break;
            }
        }
Example #7
0
        IEnumerator CNextFrame(MesssageItem m, Component component)
        {
            yield return(null);

            Deliver(m, component);
        }