Example #1
0
        static StackObject *OnStateExit_2(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 4);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Int32 layerIndex = ptr_of_this_method->Value;
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.AnimatorStateInfo stateInfo = (UnityEngine.AnimatorStateInfo) typeof(UnityEngine.AnimatorStateInfo).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            UnityEngine.Animator animator = (UnityEngine.Animator) typeof(UnityEngine.Animator).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 4);
            UnityEngine.StateMachineBehaviour instance_of_this_method;
            instance_of_this_method = (UnityEngine.StateMachineBehaviour) typeof(UnityEngine.StateMachineBehaviour).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.OnStateExit(animator, stateInfo, layerIndex);

            return(__ret);
        }
Example #2
0
        static StackObject *OnStateMachineExit_13(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 4);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Experimental.Director.AnimatorControllerPlayable controller = (UnityEngine.Experimental.Director.AnimatorControllerPlayable) typeof(UnityEngine.Experimental.Director.AnimatorControllerPlayable).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Int32 stateMachinePathHash = ptr_of_this_method->Value;
            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            UnityEngine.Animator animator = (UnityEngine.Animator) typeof(UnityEngine.Animator).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 4);
            UnityEngine.StateMachineBehaviour instance_of_this_method;
            instance_of_this_method = (UnityEngine.StateMachineBehaviour) typeof(UnityEngine.StateMachineBehaviour).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.OnStateMachineExit(animator, stateMachinePathHash, controller);

            return(__ret);
        }
Example #3
0
        static StackObject *Play_5(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, 4);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Single @normalizedTime = *(float *)&ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Int32 @layer = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            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, 4);
            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, @layer, @normalizedTime);

            return(__ret);
        }
    public void ReplacePlayerUnity(UnityEngine.CharacterController newCharacterController, UnityEngine.Animator newAnimator, UnityEngine.Transform newTransform)
    {
        var index     = GameComponentsLookup.PlayerUnity;
        var component = CreateComponent <PlayerUnityComponent>(index);

        component.characterController = newCharacterController;
        component.animator            = newAnimator;
        component.transform           = newTransform;
        ReplaceComponent(index, component);
    }
Example #5
0
        private void OnExecute(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
        {
            didExecute = true;

            Execute(animator, stateInfo, layerIndex);
        }
Example #6
0
 protected abstract void Execute(Animator animator, AnimatorStateInfo stateInfo, int layerIndex);
Example #7
0
        static StackObject *PlayClip_1(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 3);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            UnityEngine.Experimental.Director.PlayableGraph graph = (UnityEngine.Experimental.Director.PlayableGraph) typeof(UnityEngine.Experimental.Director.PlayableGraph).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.AnimationClip clip = (UnityEngine.AnimationClip) typeof(UnityEngine.AnimationClip).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            UnityEngine.Animator animator = (UnityEngine.Animator) typeof(UnityEngine.Animator).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = UnityEngine.Experimental.Director.AnimationPlayableUtilities.PlayClip(animator, clip, out graph);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            switch (ptr_of_this_method->ObjectType)
            {
            case ObjectTypes.StackObjectReference:
            {
                var    ___dst = *(StackObject **)&ptr_of_this_method->Value;
                object ___obj = graph;
                if (___dst->ObjectType >= ObjectTypes.Object)
                {
                    if (___obj is CrossBindingAdaptorType)
                    {
                        ___obj = ((CrossBindingAdaptorType)___obj).ILInstance;
                    }
                    __mStack[___dst->Value] = ___obj;
                }
                else
                {
                    ILIntepreter.UnboxObject(___dst, ___obj, __mStack, __domain);
                }
            }
            break;

            case ObjectTypes.FieldReference:
            {
                var ___obj = __mStack[ptr_of_this_method->Value];
                if (___obj is ILTypeInstance)
                {
                    ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = graph;
                }
                else
                {
                    var ___type = __domain.GetType(___obj.GetType()) as CLRType;
                    ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, graph);
                }
            }
            break;

            case ObjectTypes.StaticFieldReference:
            {
                var ___type = __domain.GetType(ptr_of_this_method->Value);
                if (___type is ILType)
                {
                    ((ILType)___type).StaticInstance[ptr_of_this_method->ValueLow] = graph;
                }
                else
                {
                    ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, graph);
                }
            }
            break;

            case ObjectTypes.ArrayReference:
            {
                var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as UnityEngine.Experimental.Director.PlayableGraph[];
                instance_of_arrayReference[ptr_of_this_method->ValueLow] = graph;
            }
            break;
            }

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
Example #8
0
 public SetAnimatorBool(UnityEngine.Animator animator, string varName, bool varValue)
 {
     _animator = animator;
     _varName  = varName;
     _varValue = varValue;
 }
Example #9
0
 private void Awake()
 {
     animator = GetComponent <UnityEngine.Animator>();
 }
Example #10
0
 public MovementFSM(UnityEngine.Animator anim) => Animator = anim;
 public WaitAnimatorState(UnityEngine.Animator animator, string tagName)
 {
     _animator = animator;
     _tagName  = tagName;
 }
 public AnimatorBoolParamContainer(UnityEngine.Animator animator, string paramName)
 {
     this.animator  = animator;
     this.paramName = paramName;
 }
 /*
  * ▒██████▒▒████████▒████████
  * ██▒▒▒▒▒▒▒██▒▒▒▒▒▒▒▒▒▒██▒▒▒
  * ▒██████▒▒████████▒▒▒▒██▒▒▒
  * ▒▒▒▒▒▒██▒██▒▒▒▒▒▒▒▒▒▒██▒▒▒
  * ▒██████▒▒████████▒▒▒▒██▒▒▒
  */
 public void SetDefaultValue()
 {
     anim  = this.GetComponent <UnityEngine.Animator>();
     state = name + "_Idle";
 }
        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!"));
        }
        static StackObject *PlayMixer_2(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 3);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            UnityEngine.Experimental.Director.PlayableGraph graph = (UnityEngine.Experimental.Director.PlayableGraph) typeof(UnityEngine.Experimental.Director.PlayableGraph).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Int32 inputCount = ptr_of_this_method->Value;
            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            UnityEngine.Animator animator = (UnityEngine.Animator) typeof(UnityEngine.Animator).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = UnityEngine.Experimental.Director.AnimationPlayableUtilities.PlayMixer(animator, inputCount, out graph);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            switch (ptr_of_this_method->ObjectType)
            {
            case ObjectTypes.StackObjectReference:
            {
                var ___dst = *(StackObject **)&ptr_of_this_method->Value;
                __mStack[___dst->Value] = graph;
            }
            break;

            case ObjectTypes.FieldReference:
            {
                var ___obj = __mStack[ptr_of_this_method->Value];
                if (___obj is ILTypeInstance)
                {
                    ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = graph;
                }
                else
                {
                    var t = __domain.GetType(___obj.GetType()) as CLRType;
                    t.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, graph);
                }
            }
            break;

            case ObjectTypes.StaticFieldReference:
            {
                var t = __domain.GetType(ptr_of_this_method->Value);
                if (t is ILType)
                {
                    ((ILType)t).StaticInstance[ptr_of_this_method->ValueLow] = graph;
                }
                else
                {
                    ((CLRType)t).SetStaticFieldValue(ptr_of_this_method->ValueLow, graph);
                }
            }
            break;

            case ObjectTypes.ArrayReference:
            {
                var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as UnityEngine.Experimental.Director.PlayableGraph[];
                instance_of_arrayReference[ptr_of_this_method->ValueLow] = graph;
            }
            break;
            }

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
 /*
   ▒██████▒▒████████▒████████
   ██▒▒▒▒▒▒▒██▒▒▒▒▒▒▒▒▒▒██▒▒▒
   ▒██████▒▒████████▒▒▒▒██▒▒▒
   ▒▒▒▒▒▒██▒██▒▒▒▒▒▒▒▒▒▒██▒▒▒
   ▒██████▒▒████████▒▒▒▒██▒▒▒
  */
 public void SetDefaultValue()
 {
     anim = this.GetComponent<UnityEngine.Animator>();
     state = name + "_Idle";
 }