// Start is called before the first frame update

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

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