Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
        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  = "";
        }
Exemplo n.º 3
0
 private void Awake()
 {
     lobbyHook = LobbyHook.Hook;
 }