Separated walk AI from demon/patron reactions.

This commit is contained in:
shakurass 2014-04-27 11:02:42 -06:00
commit 1be47add34
11 changed files with 464 additions and 886 deletions

27
Assets/Scripts/WalkAI.cs Normal file
View file

@ -0,0 +1,27 @@
using UnityEngine;
using System.Collections;
public class WalkAI : MonoBehaviour {
public GameObject[] destinations;
public int currentDestIndex = 0;
public Material evilMat;
public Material neutralMat;
private NavMeshAgent nva;
void Awake() {
nva = GetComponent<NavMeshAgent>();
nva.updateRotation = false;
nva.SetDestination(destinations[currentDestIndex].transform.position);
}
public void NextDest() {
if(currentDestIndex + 1 < destinations.Length)
++currentDestIndex;
else
currentDestIndex = 0;
nva.SetDestination(destinations[currentDestIndex].transform.position);
}
}