using UnityEngine;
using System.Collections;
public class CopAIController : MonoBehaviour {
public int team = 0;
private NavMeshAgent myAgent;
private Animator myAnimator;
public bool shouldRush;
public bool shouldHold;
private int deathCount;
private int maxBreachPoints;
private int currIndex = 0;
public GameObject[] breachPoints;
void Start()
{
deathCount = 0;
breachPoints = GameObject.FindGameObjectsWithTag("breachPoint");
maxBreachPoints = breachPoints.Length;
myAnimator = GetComponent<Animator>();
}
void Update()
{
if (shouldRush)
Breach();
if (shouldHold)
Hold();
}
void Breach()
{
if (team == 1)
{
//Error Here
myAgent.destination = breachPoints[currIndex].transform.position;
myAnimator.SetBool("isRunning", true);
}
if (team == 2)
{
//Error Here
myAgent.destination = breachPoints[currIndex + 1].transform.position;
myAnimator.SetBool("isRunning", true);
}
}
void Hold()
{
}
}