Beispiel #1
0
    void Awake()
    {
        if (instance != null)
        {
            GameObject.Destroy(instance);
        }
        else
        {
            instance = this;
        }

        DontDestroyOnLoad(this);
    }
Beispiel #2
0
    void Awake()
    {
        if (instance != null) {
            GameObject.Destroy (instance);
        } else {
            instance = this;
        }

        DontDestroyOnLoad (this);
    }