예제 #1
0
 private void SpawnPlayers()
 {
     /* Spawn players in at a random position within a random spawn zone
      * since the player objects are already created, you only need to move them */
     foreach (AgentManager player in m_GameManager.Get_Players())
     {
         SpawnZone Spawner = Get_Random_Spawn_Point();
         player.Set_Spawn_Point(Spawner.gameObject);
         Vector3 new_position = Spawner.Get_Unique_Random_Spawn_Point();
         player.Set_Position(new_position);
     }
 }
예제 #2
0
 private void Load_Security_AI()
 {
     for (int i = 0; i < m_NumberOfSecurityAI; i++)
     {
         SpawnZone    Spawner = Get_Random_Spawn_Point();
         AgentManager newAI   = new AgentManager();
         newAI.Set_Spawn_Point(Spawner.gameObject);
         //create players
         newAI.Set_Instance(Instantiate(m_SecurityAI_Prefab, Spawner.Get_Unique_Random_Spawn_Point(), newAI.Get_Spawn_Point().transform.rotation) as GameObject);
         newAI.Initialise_Agent(Agent_Type.Security_AI, 0);
         newAI.Enable();
         m_SecurityAI.Add(newAI);
         m_AllAI.Add(newAI);
     }
 }