public static LittleBossFollowPlayerState GetInstance() { if (_instance == null) { _instance = new LittleBossFollowPlayerState(); } return(_instance); }
public override void Update(LittleBossAgent agent) { if (agent.GetDistanceBtwPlayerAndReturn() < agent.GetRange()) { Debug.Log("Player is in reach"); agent.SetState(LittleBossFollowPlayerState.GetInstance()); } }
public override void Update(LittleBossAgent agent) { agent.SetPlayerAsDestination(); if (agent.GetDistanceBtwPlayerAndReturn() > agent.GetRange()) { agent.SetState(LittleBossReturnState.GetInstance()); } else if (Vector3.Distance(agent.transform.position, agent.GetDestination()) > agent.GetAttackRange()) { agent.SetState(LittleBossFollowPlayerState.GetInstance()); } else if (agent.GetCurrentTimeBtwAttacks() < 0) { agent.SetState(GetInstance()); } else { agent.UpdateAttackTime(); } //insert EXPLOSION!! }