Пример #1
0
 public override void OnEnter(CharacterStateMachine csm)
 {
     //base.OnEnter (csm);
     csm.AnimationControl.ForwardSpeed = 0;
     csm.AnimationControl.SideSpeed = 0;
     csm.Motor.ResetMoveVector ();
 }
Пример #2
0
 public override void Update(CharacterStateMachine csm, float deltaTime)
 {
     csm.Motor.ResetMoveVector ();
     if (!csm.AnimationControl.IsInAction ()) {
         csm.RevertToPreviousState ();
     }
 }
Пример #3
0
 public override void Update(CharacterStateMachine csm, float deltaTime)
 {
     if (csm.Motor.IsOnGround && csm.AnimationControl.IsJumping ()) {
         csm.AnimationControl.Land ();
         csm.SetState (CharacterState.IDLE);
     }
 }
Пример #4
0
 public override void OnEnter(CharacterStateMachine csm)
 {
     csm.AnimationControl.ForwardSpeed = 0;
     csm.AnimationControl.SideSpeed = 0;
     csm.Motor.ResetMoveVector ();
     csm.AnimationControl.Action ();
     csm.Invoke ("PlayActionSound", 0f);
 }
Пример #5
0
 public override void OnEnter(CharacterStateMachine csm)
 {
     //base.OnEnter (csm);
     if (csm.ModelObject != null) {
         ModelAudioData audioData = ModelAudioData.GetModelAudioData (csm.ModelObject);
         if (audioData.MovingClip != null) {
             csm.InvokeRepeating ("PlayMoveSound", 0f, audioData.MovingClip.length);
         }
     }
 }
Пример #6
0
        public override void Update(CharacterStateMachine csm, float deltaTime)
        {
            csm.Motor.ResetMoveVector ();

            if (csm.MotionVector.x > 0) {
                csm.Motor.MoveRight (csm.MotionVector.x);
            } else {
                csm.Motor.MoveLeft (-csm.MotionVector.x);
            }
            if (csm.MotionVector.y > 0) {
                csm.Motor.MoveForward (csm.MotionVector.y);
            } else {
                csm.Motor.MoveBack (-csm.MotionVector.y);
            }
        }
Пример #7
0
 public override void Update(CharacterStateMachine csm, float deltaTime)
 {
     //base.Update (csm, deltaTime);
     csm.Motor.ResetMoveVector ();
     if (csm.MotionVector.y > 0) {
         if (csm.MotionVector.x > 0) {
             csm.Motor.MoveRight (csm.MotionVector.x);
         } else {
             csm.Motor.MoveLeft (-csm.MotionVector.x);
         }
         csm.Motor.MoveForward (csm.MotionVector.y);
     } else {
         csm.Motor.MoveBack (-csm.MotionVector.y);
     }
     csm.AnimationControl.ForwardSpeed = csm.MotionVector.y;
     csm.AnimationControl.SideSpeed = csm.MotionVector.x;
 }
Пример #8
0
 public override void OnExit(CharacterStateMachine csm)
 {
     csm.Motor.GravityAffect = true;
 }
Пример #9
0
 public override void OnEnter(CharacterStateMachine csm)
 {
     csm.Motor.GravityAffect = false;
     csm.AnimationControl.ForwardSpeed = 0;
     csm.Motor.ResetMoveVector ();
 }
Пример #10
0
 public virtual void Update(CharacterStateMachine csm, float deltaTime = 0f)
 {
     if (deltaTime == 0f) {
         deltaTime = Time.deltaTime;
     }
 }
Пример #11
0
 public virtual void OnExit(CharacterStateMachine csm)
 {
 }
Пример #12
0
 public override void OnExit(CharacterStateMachine csm)
 {
     //base.OnExit (csm);
     csm.CancelInvoke ("PlayMoveSound");
 }
Пример #13
0
 public override void OnEnter(CharacterStateMachine csm)
 {
     csm.AnimationControl.Jump ();
     csm.Motor.Jump ();
 }