Exemplo n.º 1
0
 public void ChangeState(Istate state)
 {
     if (currentState != null)
     {
         currentState.Exit();
     }
     currentState = state;
     Debug.Assert(currentState != null);
 }
Exemplo n.º 2
0
 private void Start()
 {
     idleState       = new IdleState(this);
     moveState       = new MoveState(this);
     attackState     = new AttackState(this);
     currentState    = idleState;
     O               = transform.position;
     AttackDistance  = 8;
     Distance        = 5;
     _animator       = GetComponent <Animator>();
     _spriteRenderer = GetComponent <SpriteRenderer>();
     killfox         = true;
     KillFoxSec      = 1;
     ScareLock       = true;
     KillLock        = true;
     state2          = false;
     MoveSpeed       = 10f;
     MoveSpeed2      = 0.0001f;
     // _animator.SetFloat("AniSpeed",AniSpeed);
 }
Exemplo n.º 3
0
 public void ChangeState(Istate nextstate)
 {
     currentState.OnstateExit();
     nextstate.OnStateEnter();
     currentState = nextstate;
 }