Separated walk AI from demon/patron reactions.
This commit is contained in:
parent
0a866b7574
commit
1be47add34
11 changed files with 464 additions and 886 deletions
|
|
@ -3,28 +3,6 @@ using System.Collections;
|
|||
|
||||
public class Patron : 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);
|
||||
}
|
||||
|
||||
void OnTriggerEnter(Collider other) {
|
||||
|
||||
//Instantiate(explosion, transform.position, transform.rotation);
|
||||
|
|
@ -33,14 +11,5 @@ public class Patron : MonoBehaviour {
|
|||
//Instantiate (playerExplosion, other.transform.position, other.transform.rotation);
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
if (other.tag == "VVAura") {
|
||||
renderer.material = evilMat;
|
||||
}
|
||||
|
||||
// gameController.AddScore (scoreValue);
|
||||
//
|
||||
// Destroy (other.gameObject);
|
||||
// Destroy (gameObject);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue