Esempio n. 1
0
 //Init
 void Start()
 {
     //The nav pool is pulled from the Player
     playerNavPool = player.GetComponent <AI_General_Navpoint_Pool>();
     //The targeter is pulled from the NPC
     targeter = GetComponentInChildren <AI_NPC_Targeter>();
     //Get the shotpoint
     shotpoint = GetComponentInChildren <AI_NPC_Shotpoint>();
     //The agent is pulled from the NPC
     agent = GetComponent <NavMeshAgent>();
     //Set the nav point to the player using the method to do this
     SetPoint_Player();
     //Call the check if player is moving cycler
     StartCoroutine(Check_If_Player_Moving_CO());
     //Call the nav cycler
     StartCoroutine(Goto_CO());
 }
Esempio n. 2
0
 //Sets the destination to a zone position and goes to it
 void SetPoint_Zone()
 {
     if (player.zone != null)
     {
         AI_General_Navpoint_Pool navPool =
             player.
             zone.
             GetComponent <AI_General_Navpoint_Pool>();
         if ((goto_This =
                  navPool.
                  Claim_Open_Navpoint(
                      transform).
                  transform) == null) //NULL HAPPENS HERE (transform)
         {
             Debug.Log("Tried to get a point but no point was received.");
         }
         else
         {
             Debug.Log("Tried to get a point - and got one.");
         }
         ;
     }
 }