예제 #1
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);

        levelManager = GetComponent <LevelManager>();

        InitGame();
    }
예제 #2
0
 void Awake()
 {
     // Let's setup our singleton instance
     instance = this;
 }