PlayQueued() public méthode

public PlayQueued ( string animation ) : AnimationState
animation string
Résultat AnimationState
    //public GameObject _player;
    //public float _distance;
    // Use this for initialization
    void Start()
    {
        _animation = GetComponent<Animation> ();
        string _animationToPlay = _animationClip.name.ToString();

        //int animCount = _animation.GetClipCount(); // clip?! Unity people, why not state??
        //Debug.Log("Animations found: " + animCount );

        //_player = GameObject.FindGameObjectWithTag("Player");

        _animation[_animationToPlay].wrapMode = WrapMode.Loop;

        _animation.PlayQueued(_animationToPlay, QueueMode.CompleteOthers);

        //		foreach(AnimationState s in _animation) {
        //
        //			string theName = s.name.ToString();
        //			//_animation[theName].wrapMode = WrapMode.Once;
        //			_animation.PlayQueued(theName, QueueMode.CompleteOthers);
        //
        //
        //
        //		}
        //
    }
        public void QueueAnimation(AnimType animType)
        {
            var clip  = GetClip(animType);
            var speed = GetSpeed(animType);

            if (!clip)
            {
                return;
            }

            SetClipToStart(animType);
            SetAnimationSpeed(clip, speed);
            anim.PlayQueued(clip.name);
        }
Exemple #3
0
 static public int PlayQueued(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 2)
         {
             UnityEngine.Animation self = (UnityEngine.Animation)checkSelf(l);
             System.String         a1;
             checkType(l, 2, out a1);
             var ret = self.PlayQueued(a1);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (argc == 3)
         {
             UnityEngine.Animation self = (UnityEngine.Animation)checkSelf(l);
             System.String         a1;
             checkType(l, 2, out a1);
             UnityEngine.QueueMode a2;
             checkEnum(l, 3, out a2);
             var ret = self.PlayQueued(a1, a2);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (argc == 4)
         {
             UnityEngine.Animation self = (UnityEngine.Animation)checkSelf(l);
             System.String         a1;
             checkType(l, 2, out a1);
             UnityEngine.QueueMode a2;
             checkEnum(l, 3, out a2);
             UnityEngine.PlayMode a3;
             checkEnum(l, 4, out a3);
             var ret = self.PlayQueued(a1, a2, a3);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
    static int PlayQueued(IntPtr L)
    {
#if UNITY_EDITOR
        ToluaProfiler.AddCallRecord("UnityEngine.Animation.Register");
#endif
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                UnityEngine.Animation obj = (UnityEngine.Animation)ToLua.CheckObject(L, 1, typeof(UnityEngine.Animation));
                string arg0 = ToLua.CheckString(L, 2);
                UnityEngine.AnimationState o = obj.PlayQueued(arg0);
                ToLua.PushSealed(L, o);
                return(1);
            }
            else if (count == 3)
            {
                UnityEngine.Animation obj = (UnityEngine.Animation)ToLua.CheckObject(L, 1, typeof(UnityEngine.Animation));
                string arg0 = ToLua.CheckString(L, 2);
                UnityEngine.QueueMode      arg1 = (UnityEngine.QueueMode)ToLua.CheckObject(L, 3, typeof(UnityEngine.QueueMode));
                UnityEngine.AnimationState o    = obj.PlayQueued(arg0, arg1);
                ToLua.PushSealed(L, o);
                return(1);
            }
            else if (count == 4)
            {
                UnityEngine.Animation obj = (UnityEngine.Animation)ToLua.CheckObject(L, 1, typeof(UnityEngine.Animation));
                string arg0 = ToLua.CheckString(L, 2);
                UnityEngine.QueueMode      arg1 = (UnityEngine.QueueMode)ToLua.CheckObject(L, 3, typeof(UnityEngine.QueueMode));
                UnityEngine.PlayMode       arg2 = (UnityEngine.PlayMode)ToLua.CheckObject(L, 4, typeof(UnityEngine.PlayMode));
                UnityEngine.AnimationState o    = obj.PlayQueued(arg0, arg1, arg2);
                ToLua.PushSealed(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.Animation.PlayQueued"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
 static public int PlayQueued__String__QueueMode(IntPtr l)
 {
     try {
         UnityEngine.Animation self = (UnityEngine.Animation)checkSelf(l);
         System.String         a1;
         checkType(l, 2, out a1);
         UnityEngine.QueueMode a2;
         checkEnum(l, 3, out a2);
         var ret = self.PlayQueued(a1, a2);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 public static int PlayQueued2_wrap(long L)
 {
     try
     {
         long nThisPtr             = FCLibHelper.fc_get_inport_obj_ptr(L);
         UnityEngine.Animation obj = get_obj(nThisPtr);
         string arg0 = FCLibHelper.fc_get_string_a(L, 0);
         UnityEngine.AnimationState ret = obj.PlayQueued(arg0);
         long ret_ptr = FCLibHelper.fc_get_return_ptr(L);
         long v       = FCGetObj.PushObj(ret);
         FCLibHelper.fc_set_value_wrap_objptr(ret_ptr, v);
     }
     catch (Exception e)
     {
         Debug.LogException(e);
     }
     return(0);
 }
 static public int PlayQueued(IntPtr l)
 {
     try{
         if (matchType(l, 2, typeof(string), typeof(UnityEngine.QueueMode), typeof(UnityEngine.PlayMode)))
         {
             UnityEngine.Animation self = (UnityEngine.Animation)checkSelf(l);
             System.String         a1;
             checkType(l, 2, out a1);
             UnityEngine.QueueMode a2;
             checkEnum(l, 3, out a2);
             UnityEngine.PlayMode a3;
             checkEnum(l, 4, out a3);
             UnityEngine.AnimationState ret = self.PlayQueued(a1, a2, a3);
             pushValue(l, ret);
             return(1);
         }
         else if (matchType(l, 2, typeof(string), typeof(UnityEngine.QueueMode)))
         {
             UnityEngine.Animation self = (UnityEngine.Animation)checkSelf(l);
             System.String         a1;
             checkType(l, 2, out a1);
             UnityEngine.QueueMode a2;
             checkEnum(l, 3, out a2);
             UnityEngine.AnimationState ret = self.PlayQueued(a1, a2);
             pushValue(l, ret);
             return(1);
         }
         else if (matchType(l, 2, typeof(string)))
         {
             UnityEngine.Animation self = (UnityEngine.Animation)checkSelf(l);
             System.String         a1;
             checkType(l, 2, out a1);
             UnityEngine.AnimationState ret = self.PlayQueued(a1);
             pushValue(l, ret);
             return(1);
         }
         LuaDLL.luaL_error(l, "No matched override function to call");
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
    static int PlayQueued(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                UnityEngine.Animation obj = (UnityEngine.Animation)ToLua.CheckObject(L, 1, typeof(UnityEngine.Animation));
                string arg0 = ToLua.CheckString(L, 2);
                UnityEngine.AnimationState o = obj.PlayQueued(arg0);
                ToLua.PushSealed(L, o);
                return(1);
            }
            else if (count == 3)
            {
                UnityEngine.Animation obj = (UnityEngine.Animation)ToLua.CheckObject(L, 1, typeof(UnityEngine.Animation));
                string arg0 = ToLua.CheckString(L, 2);
                UnityEngine.QueueMode      arg1 = (UnityEngine.QueueMode)LuaDLL.luaL_checknumber(L, 3);
                UnityEngine.AnimationState o    = obj.PlayQueued(arg0, arg1);
                ToLua.PushSealed(L, o);
                return(1);
            }
            else if (count == 4)
            {
                UnityEngine.Animation obj = (UnityEngine.Animation)ToLua.CheckObject(L, 1, typeof(UnityEngine.Animation));
                string arg0 = ToLua.CheckString(L, 2);
                UnityEngine.QueueMode      arg1 = (UnityEngine.QueueMode)LuaDLL.luaL_checknumber(L, 3);
                UnityEngine.PlayMode       arg2 = (UnityEngine.PlayMode)LuaDLL.luaL_checknumber(L, 4);
                UnityEngine.AnimationState o    = obj.PlayQueued(arg0, arg1, arg2);
                ToLua.PushSealed(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.Animation.PlayQueued"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
    static int PlayQueued(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && ToLua.CheckTypes(L, 1, typeof(UnityEngine.Animation), typeof(string)))
            {
                UnityEngine.Animation obj = (UnityEngine.Animation)ToLua.ToObject(L, 1);
                string arg0 = ToLua.ToString(L, 2);
                UnityEngine.AnimationState o = obj.PlayQueued(arg0);
                ToLua.Push(L, o);
                return(1);
            }
            else if (count == 3 && ToLua.CheckTypes(L, 1, typeof(UnityEngine.Animation), typeof(string), typeof(UnityEngine.QueueMode)))
            {
                UnityEngine.Animation obj = (UnityEngine.Animation)ToLua.ToObject(L, 1);
                string arg0 = ToLua.ToString(L, 2);
                UnityEngine.QueueMode      arg1 = (UnityEngine.QueueMode)ToLua.ToObject(L, 3);
                UnityEngine.AnimationState o    = obj.PlayQueued(arg0, arg1);
                ToLua.Push(L, o);
                return(1);
            }
            else if (count == 4 && ToLua.CheckTypes(L, 1, typeof(UnityEngine.Animation), typeof(string), typeof(UnityEngine.QueueMode), typeof(UnityEngine.PlayMode)))
            {
                UnityEngine.Animation obj = (UnityEngine.Animation)ToLua.ToObject(L, 1);
                string arg0 = ToLua.ToString(L, 2);
                UnityEngine.QueueMode      arg1 = (UnityEngine.QueueMode)ToLua.ToObject(L, 3);
                UnityEngine.PlayMode       arg2 = (UnityEngine.PlayMode)ToLua.ToObject(L, 4);
                UnityEngine.AnimationState o    = obj.PlayQueued(arg0, arg1, arg2);
                ToLua.Push(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.tolua_error(L, "invalid arguments to method: UnityEngine.Animation.PlayQueued"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
 static int QPYX_PlayQueued_YXQP(IntPtr L_YXQP)
 {
     try
     {
         int QPYX_count_YXQP = LuaDLL.lua_gettop(L_YXQP);
         if (QPYX_count_YXQP == 2)
         {
             UnityEngine.Animation QPYX_obj_YXQP = (UnityEngine.Animation)ToLua.CheckObject(L_YXQP, 1, typeof(UnityEngine.Animation));
             string QPYX_arg0_YXQP = ToLua.CheckString(L_YXQP, 2);
             UnityEngine.AnimationState QPYX_o_YXQP = QPYX_obj_YXQP.PlayQueued(QPYX_arg0_YXQP);
             ToLua.PushSealed(L_YXQP, QPYX_o_YXQP);
             return(1);
         }
         else if (QPYX_count_YXQP == 3)
         {
             UnityEngine.Animation QPYX_obj_YXQP = (UnityEngine.Animation)ToLua.CheckObject(L_YXQP, 1, typeof(UnityEngine.Animation));
             string QPYX_arg0_YXQP = ToLua.CheckString(L_YXQP, 2);
             UnityEngine.QueueMode      QPYX_arg1_YXQP = (UnityEngine.QueueMode)ToLua.CheckObject(L_YXQP, 3, typeof(UnityEngine.QueueMode));
             UnityEngine.AnimationState QPYX_o_YXQP    = QPYX_obj_YXQP.PlayQueued(QPYX_arg0_YXQP, QPYX_arg1_YXQP);
             ToLua.PushSealed(L_YXQP, QPYX_o_YXQP);
             return(1);
         }
         else if (QPYX_count_YXQP == 4)
         {
             UnityEngine.Animation QPYX_obj_YXQP = (UnityEngine.Animation)ToLua.CheckObject(L_YXQP, 1, typeof(UnityEngine.Animation));
             string QPYX_arg0_YXQP = ToLua.CheckString(L_YXQP, 2);
             UnityEngine.QueueMode      QPYX_arg1_YXQP = (UnityEngine.QueueMode)ToLua.CheckObject(L_YXQP, 3, typeof(UnityEngine.QueueMode));
             UnityEngine.PlayMode       QPYX_arg2_YXQP = (UnityEngine.PlayMode)ToLua.CheckObject(L_YXQP, 4, typeof(UnityEngine.PlayMode));
             UnityEngine.AnimationState QPYX_o_YXQP    = QPYX_obj_YXQP.PlayQueued(QPYX_arg0_YXQP, QPYX_arg1_YXQP, QPYX_arg2_YXQP);
             ToLua.PushSealed(L_YXQP, QPYX_o_YXQP);
             return(1);
         }
         else
         {
             return(LuaDLL.luaL_throw(L_YXQP, "invalid arguments to method: UnityEngine.Animation.PlayQueued"));
         }
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
 static public int PlayQueued(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 2)
         {
             UnityEngine.Animation self = (UnityEngine.Animation)checkSelf(l);
             System.String         a1;
             checkType(l, 2, out a1);
             var ret = self.PlayQueued(a1);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (argc == 3)
         {
             UnityEngine.Animation self = (UnityEngine.Animation)checkSelf(l);
             System.String         a1;
             checkType(l, 2, out a1);
             UnityEngine.QueueMode a2;
             a2 = (UnityEngine.QueueMode)LuaDLL.luaL_checkinteger(l, 3);
             var ret = self.PlayQueued(a1, a2);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (argc == 4)
         {
             UnityEngine.Animation self = (UnityEngine.Animation)checkSelf(l);
             System.String         a1;
             checkType(l, 2, out a1);
             UnityEngine.QueueMode a2;
             a2 = (UnityEngine.QueueMode)LuaDLL.luaL_checkinteger(l, 3);
             UnityEngine.PlayMode a3;
             a3 = (UnityEngine.PlayMode)LuaDLL.luaL_checkinteger(l, 4);
             var ret = self.PlayQueued(a1, a2, a3);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function PlayQueued to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
 private bool PlayAnimation(Animation animation, string name)
 {
     bool b = false;
     if(animation != null && name != "" && animation[name] != null)
     {
         if(this.show) animation[name].layer = this.min;
         if(this.playOptions[this.number] == "Play")
         {
             animation.Play(name, this.playMode);
         }
         else if(this.playOptions[this.number] == "CrossFade")
         {
             animation.CrossFade(name, this.time, this.playMode);
         }
         else if(this.playOptions[this.number] == "Blend")
         {
             animation.Blend(name, this.speed, this.time);
         }
         else if(this.playOptions[this.number] == "PlayQueued")
         {
             animation.PlayQueued(name, this.queueMode, this.playMode);
         }
         else if(this.playOptions[this.number] == "CrossFadeQueued")
         {
             animation.CrossFadeQueued(name, this.time, this.queueMode, this.playMode);
         }
         b = true;
     }
     return b;
 }
 IEnumerator DelayAnimation(Animation Anim, string Name)
 {
     m_animCount++;
     yield return new WaitForSeconds(m_animCount * m_delay);
     Anim.PlayQueued(Name, QueueMode.CompleteOthers);
 }
 // Use this for initialization
 void Start()
 {
     Player = GameObject.FindGameObjectWithTag("Player");
     r = new System.Random();
     anim = transform.Find ("model").animation;
     transform.Find("board_model").gameObject.SetActive(false);
     anim.Play ("Walk Start");
     anim.PlayQueued("Walk Loop");
     AudioSource[] aSources = GetComponents<AudioSource>();
     footsteps = aSources[0];
     talk = aSources[1];
 }