예제 #1
0
 public void StopSkillAnimation(int actorId)
 {
     UnityEngine.GameObject obj = GetGameObject(actorId);
     if (null != obj)
     {
         UnityEngine.Animator animator = obj.GetComponentInChildren <UnityEngine.Animator>();
         if (null != animator)
         {
             animator.Play("Stand");
         }
     }
 }
예제 #2
0
        static StackObject *Play_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.String @stateName = (System.String) typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.Animator instance_of_this_method = (UnityEngine.Animator) typeof(UnityEngine.Animator).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Play(@stateName);

            return(__ret);
        }
예제 #3
0
 private void PlayState(string stateName)
 {
     anim.Play(stateName);
 }
예제 #4
0
        static int _m_Play(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            UnityEngine.Animator __cl_gen_to_be_invoked = (UnityEngine.Animator)translator.FastGetCSObj(L, 1);


            int __gen_param_count = LuaAPI.lua_gettop(L);

            try {
                if (__gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
                {
                    int stateNameHash = LuaAPI.xlua_tointeger(L, 2);

                    __cl_gen_to_be_invoked.Play(stateNameHash);



                    return(0);
                }
                if (__gen_param_count == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3))
                {
                    int stateNameHash = LuaAPI.xlua_tointeger(L, 2);
                    int layer         = LuaAPI.xlua_tointeger(L, 3);

                    __cl_gen_to_be_invoked.Play(stateNameHash, layer);



                    return(0);
                }
                if (__gen_param_count == 4 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4))
                {
                    int   stateNameHash  = LuaAPI.xlua_tointeger(L, 2);
                    int   layer          = LuaAPI.xlua_tointeger(L, 3);
                    float normalizedTime = (float)LuaAPI.lua_tonumber(L, 4);

                    __cl_gen_to_be_invoked.Play(stateNameHash, layer, normalizedTime);



                    return(0);
                }
                if (__gen_param_count == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
                {
                    string stateName = LuaAPI.lua_tostring(L, 2);

                    __cl_gen_to_be_invoked.Play(stateName);



                    return(0);
                }
                if (__gen_param_count == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3))
                {
                    string stateName = LuaAPI.lua_tostring(L, 2);
                    int    layer     = LuaAPI.xlua_tointeger(L, 3);

                    __cl_gen_to_be_invoked.Play(stateName, layer);



                    return(0);
                }
                if (__gen_param_count == 4 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4))
                {
                    string stateName      = LuaAPI.lua_tostring(L, 2);
                    int    layer          = LuaAPI.xlua_tointeger(L, 3);
                    float  normalizedTime = (float)LuaAPI.lua_tonumber(L, 4);

                    __cl_gen_to_be_invoked.Play(stateName, layer, normalizedTime);



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Animator.Play!"));
        }