private AI_GroundAttack doSpawn() { totalSpawnCount++; CombatFlow newAircraft = gm.spawnPlayer(CombatFlow.convertTeamToNum(spawner.team), true); AI_GroundAttack newAirGndAtk = newAircraft.GetComponent <AI_GroundAttack>(); newAirGndAtk.assignToLane(decideLane(myAI)); newAircraft.setNetName("JeffBot" + totalSpawnCount); return(newAirGndAtk); }
public GameObject spawnPlayer(GameObject playerPrefab, string name, bool isPlayer = true) { //playerPrefab.name = PhotonNetwork.NickName; GameObject emptySpawn = findEmptySpawnPoint(); GameObject player = PhotonNetwork.Instantiate(playerPrefab.name, emptySpawn.transform.position, Quaternion.identity, 0); if (isPlayer) { localPlayerInstance = player; } player.transform.rotation = emptySpawn.transform.rotation; CombatFlow playerFlow = player.GetComponent <CombatFlow>(); playerFlow.setNetName(name); playerFlow.setNetTeam(CombatFlow.convertTeamToNum(team)); return(player); }