public override void OnEnter(CharacterStateMachine csm)
 {
     //base.OnEnter (csm);
     csm.AnimationControl.ForwardSpeed = 0;
     csm.AnimationControl.SideSpeed = 0;
     csm.Motor.ResetMoveVector ();
 }
Esempio n. 2
0
 public override void Update(CharacterStateMachine csm, float deltaTime)
 {
     csm.Motor.ResetMoveVector ();
     if (!csm.AnimationControl.IsInAction ()) {
         csm.RevertToPreviousState ();
     }
 }
Esempio n. 3
0
 public override void Update(CharacterStateMachine csm, float deltaTime)
 {
     if (csm.Motor.IsOnGround && csm.AnimationControl.IsJumping ()) {
         csm.AnimationControl.Land ();
         csm.SetState (CharacterState.IDLE);
     }
 }
Esempio n. 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);
 }
Esempio n. 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);
         }
     }
 }
Esempio n. 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);
            }
        }
Esempio n. 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;
 }
Esempio n. 8
0
 public override void OnExit(CharacterStateMachine csm)
 {
     csm.Motor.GravityAffect = true;
 }
Esempio n. 9
0
 public override void OnEnter(CharacterStateMachine csm)
 {
     csm.Motor.GravityAffect = false;
     csm.AnimationControl.ForwardSpeed = 0;
     csm.Motor.ResetMoveVector ();
 }
Esempio n. 10
0
 public virtual void Update(CharacterStateMachine csm, float deltaTime = 0f)
 {
     if (deltaTime == 0f) {
         deltaTime = Time.deltaTime;
     }
 }
Esempio n. 11
0
 public virtual void OnExit(CharacterStateMachine csm)
 {
 }
Esempio n. 12
0
 public override void OnExit(CharacterStateMachine csm)
 {
     //base.OnExit (csm);
     csm.CancelInvoke ("PlayMoveSound");
 }
Esempio n. 13
0
 public override void OnEnter(CharacterStateMachine csm)
 {
     csm.AnimationControl.Jump ();
     csm.Motor.Jump ();
 }