Exemplo n.º 1
0
        public virtual void OnStart()
        {
            ((Task)this).OnStart();
            AgentActor agent = this.Agent;

            if (!Object.op_Inequality((Object)agent.Partner, (Object)null))
            {
                return;
            }
            agent.StopNavMeshAgent();
            agent.ChangeStaticNavMeshAgentAvoidance();
            PlayState.AnimStateInfo idleStateInfo = Singleton <Resources> .Instance.DefinePack.AnimatorState.IdleStateInfo;
            float angleFromForward = this.Agent.Partner.Animation.GetAngleFromForward(((Component)agent).get_transform().get_forward());

            agent.Animation.PlayTurnAnimation(angleFromForward, 1f, idleStateInfo);
        }
Exemplo n.º 2
0
        private void PlayTurnAnimation()
        {
            PlayState.AnimStateInfo personalIdleState = this._agent.GetTutorialPersonalIdleState();
            Vector3 to  = Vector3.op_Addition(Vector3.op_Multiply(this._point.Forward, 30f), this._agent.Position);
            float   num = Vector3.Angle(Vector3.op_Subtraction(to, this._agent.Position), this._agent.Forward);

            if (Singleton <Resources> .IsInstance())
            {
                float turnEnableAngle = Singleton <Resources> .Instance.LocomotionProfile.TurnEnableAngle;
                if ((double)num < (double)turnEnableAngle)
                {
                    ((Component)this._agent.Locomotor).get_transform().LookAt(to, Vector3.get_up());
                    Vector3 eulerAngles = ((Component)this._agent.Locomotor).get_transform().get_eulerAngles();
                    eulerAngles.x = (__Null)(double)(eulerAngles.z = (__Null)0.0f);
                    ((Component)this._agent.Locomotor).get_transform().set_eulerAngles(eulerAngles);
                    return;
                }
            }
            this._agent.Animation.StopAllAnimCoroutine();
            this._animation.PlayTurnAnimation(to, 1f, personalIdleState, false);
        }