public void Execute() { if (owner.InRangeToAttack()) { if (owner.GetTimeToAttack() > 0) { owner.DecreaseTimeToAttack(Time.deltaTime); owner.GetAnimator().SetBool("attack", false); } else { owner.GetAnimator().SetBool("attack", true); owner.PerformAttack(); owner.ResetTimeToAttack(); } } else { owner.GetStateMachineEnemy().SetState(new EnemyMovingState(owner)); } }
public void Enter() { owner.GetAnimator().SetFloat("speed", 1.0f); }