private void Awake() { // Sort of Singleton Pattern - keep the new instance // This is so the events & references set in the editor // don't get lost when the other instance is destroyed if (instance == null) { instance = this; } else if (instance != this) { Destroy(instance.gameObject); // Keep only one instance instance = this; } DontDestroyOnLoad(gameObject); }
private void Awake() { // Sort of Singleton Pattern - keep the new instance // This is so the events & references set in the editor // don't get lost when the other instance is destroyed if (instance == null) { instance = this; } else if (instance != this) { Destroy(instance.gameObject); // Keep only one instance instance = this; } DontDestroyOnLoad(gameObject); lobbyHook = GetComponent <LobbyHook>(); serverStatus = new ServerStatus(); originalLobby = offlineScene; offlineScene = ""; }
private void Awake() { lobbyHook = LobbyHook.Hook; }