using UnityEngine;
using System.Collections;
public class PatrolState : IEnemyState
{
private Enemy enemy;
private float patrolTimer;
private float patrolDuration
public void Enter(Enemy enemy)
{
this.enemy = enemy;
}
public void Execute()
{
Debug.Log ("Patroling");
Patrol ();
}
public void Exit()
{
}
public void OnTriggerEnter (Collider2D other)
{
}
private void Patrol()
{
patrolTimer += Time.deltaTime;
if (patrolTimer >= patrolDuration)
{
enemy.ChangeState (new IdleState ());
}
}
}