Exemple #1
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(this.gameObject);
         Debug.Log("ErrorInfoPanel Awake");
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
Exemple #2
0
    void Awake()
    {
        if (instance == null)
        {
            gameApp        = GameObject.Find("GameApp").GetComponent <GameApp>();
            levelLoader    = GameObject.Find("LevelLoader").GetComponent <LevelLoader>();
            errorInfoPanel = GameObject.Find("ErrorInfoCanvas").GetComponent <ErrorInfoPanel>();

            DontDestroyOnLoad(this.gameObject);
            instance = this;
            Debug.Log("Awake: " + this.gameObject);
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }
    }
    void Awake()
    {
        if (instance == null)
        {
            connections      = new Dictionary <string, NetworkConnection>();
            connectionsIsNew = new HashSet <NetworkConnection>();

            levelLoader    = GameObject.Find("LevelLoader").GetComponent <LevelLoader>();
            gameApp        = GameObject.Find("GameApp").GetComponent <GameApp>();
            errorInfoPanel = GameObject.Find("ErrorInfoCanvas").GetComponent <ErrorInfoPanel>();

            DontDestroyOnLoad(this.gameObject);
            instance = this;
            Debug.Log("Awake: " + this.gameObject);
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }
    }