// Start is called before the first frame update void Start() { countdownTimer = COUNTDOWN_LENGTH; curEvent = EVENT_NONE; lastEvent = EVENT_NONE; eventParams = 0; DontDestroyOnLoad(this.gameObject); if (isServer) { playerObjects = new GameObject[] { null, null, null, null, null, null, null, null }; } else { playerObjects = null; networkManager = null; } spawnManager = null; localClient = GameObject.FindObjectOfType <NeonHeightsLobbyClient2>(); connectionId = -1; numberOfPlayers = 0; nextLevel = "random"; gameStarted = false; playerConnectionIDs.Callback += OnPlayerConnectionIDsUpdated; //SyncList.Callback is called the variable is changed //on the server }
public Vector3 GetPlayerSpawn(int pNum) { if (spawnManager == null) { spawnManager = GameObject.FindObjectOfType <NeonHeightsSpawnManager>(); } Player curPlayer = null; foreach (Player player in players) { if (player.playerNum == pNum) { curPlayer = player; break; } } Vector3 toReturn = spawnManager.GetNextSpawn(curPlayer.team); return(toReturn); }
// Start is called before the first frame update void Start() { Destroy(gameObject.GetComponent <SpriteRenderer>()); spawnManager = GameObject.FindObjectOfType <NeonHeightsSpawnManager>(); spawnManager.RegisterSpawn(this); }