Example #1
0
 // Use this for initialization
 void Start()
 {
     cc             = GetComponent <CharacterController>();
     academy        = GameObject.Find("Academy").GetComponent <NpcaiAcademy>();
     rayPer         = GetComponent <ObjectPerception>();
     rayPer.player  = this;
     lastEpisode    = currentTime.Second;
     trainingGround = GetComponentInParent <TrainingGround>();
     target         = trainingGround.GetComponentInChildren <TreasureController>();
     //target.gameObject.SetActive(false);
     agentRb = GetComponent <Rigidbody>();
 }
Example #2
0
 // Use this for initialization
 void Start()
 {
     cc             = GetComponent <CharacterController>();
     cc.enabled     = false;
     academy        = GameObject.Find("Academy").GetComponent <NpcaiAcademy>();
     rayPer         = GetComponent <ObjectPerception>();
     rayPer.enemy   = this;
     lastEpisode    = Timer.time;
     trainingGround = GetComponentInParent <TrainingGround>();
     isAlive        = true;
     deathTime      = 0;
     target         = trainingGround.GetComponentInChildren <TreasureController>();
     agentRb        = GetComponent <Rigidbody>();
     disToTarget    = float.MaxValue;
     player         = trainingGround.GetComponentInChildren <NpcAIAgent>();
 }