Example #1
0
    // Start is called before the first frame update

    private void Awake()
    {
        if (instance != null && instance != this)
        {
            gameObject.SetActive(false);
        }
        else
        {
            instance = this;
            DontDestroyOnLoad(gameObject);
        }
    }
Example #2
0
    // Start is called before the first frame update

    private void Awake()
    {
        instance = this;
        DontDestroyOnLoad(gameObject);
    }