Example #1
0
        public void Update(float deltaT)
        {
            if (navMeshAgent.enabled)
            {
                navMeshAgent.enabled = false;
            }

            ragdollSinkTimer += deltaT;
            //UnityEngine.Debug.Log("Ragdoll sink timer = " + ragdollSinkTimer);
            if (ragdollSinkTimer > startRagdollSink)
            {
                Sink(deltaT);
            }

            if (animatedDeath)
            {
                //Animation event cannot link to any functions here without using a wrapper from a MonoBehaviour script attached to the zombie.
                if (animator.GetBool("isWalking"))
                {
                    animator.SetBool("isWalking", false);
                }
                if (!animator.GetBool("isDead"))
                {
                    animator.SetBool("isDead", true);
                }
                return;
            }


            if (ragdollRB == null)
            {
                EnableRigidBodyPhysics();
            }
        }
Example #2
0
        protected override void OnExecute()
        {
            if (_animator == null)
            {
                Status = ActionStatus.Finished;
                return;
            }

            _animator.SetBool(_varName, _varValue);

            Status = ActionStatus.Finished;
        }
        static int _m_SetBool(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 == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3))
                {
                    int  id    = LuaAPI.xlua_tointeger(L, 2);
                    bool value = LuaAPI.lua_toboolean(L, 3);

                    __cl_gen_to_be_invoked.SetBool(id, value);



                    return(0);
                }
                if (__gen_param_count == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3))
                {
                    string name  = LuaAPI.lua_tostring(L, 2);
                    bool   value = LuaAPI.lua_toboolean(L, 3);

                    __cl_gen_to_be_invoked.SetBool(name, value);



                    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.SetBool!"));
        }
        static StackObject *SetBool_2(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, 3);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Boolean @value = ptr_of_this_method->Value == 1;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.String @name = (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, 3);
            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.SetBool(@name, @value);

            return(__ret);
        }
Example #5
0
 public void SetBool(string parameterName, bool value)
 {
     animator.SetBool(parameterName, value);
 }