示例#1
0
 // Use this for initialization
 void Start()
 {
     behaviourTree   = new BTEnemy(this);
     navAgent        = gameObject.GetComponent <NavMeshAgent>();
     playerSeen      = gameObject.GetComponentInChildren <BoxDetection>();
     distracted      = gameObject.GetComponentInChildren <Distracted>();
     questionMark    = gameObject.transform.Find("Question Mark").GetComponent <SpriteRenderer>();
     exclamationMark = gameObject.transform.Find("Exclamation Mark").GetComponent <SpriteRenderer>();
     sphereAlert     = gameObject.GetComponentInChildren <SphereCollider>().radius;
     blackboard      = gameObject.GetComponentInChildren <Blackboard>();
 }
示例#2
0
 // Use this for initialization
 void Start()
 {
     behaviourTree = new BTEnemy(this);
     navAgent      = gameObject.GetComponent <NavMeshAgent>();
     activeStates  = gameObject.GetComponentInChildren <Nodes>();
 }