Esempio n. 1
0
    void Start()
    {
        if (instance)
            Destroy(gameObject);

        instance = this;
        DontDestroyOnLoad(gameObject);
        OnLevelWasLoaded(0);
    }
Esempio n. 2
0
    void Start()
    {
        if (instance)
        {
            Destroy(gameObject);
        }

        instance = this;
        DontDestroyOnLoad(gameObject);
        OnLevelWasLoaded(0);
    }
Esempio n. 3
0
    void Start()
    {
        if (instance)
        {
            Destroy(gameObject);
        }

        instance = this;
        DontDestroyOnLoad(gameObject);

        ActivateSurroundings();
        SceneManager.sceneLoaded += OnLevelLoaded;
    }
Esempio n. 4
0
    void Start()
    {
        if (instance)
        {
            Destroy(gameObject);
        }

        instance = this;
        DontDestroyOnLoad(gameObject);

        #if UNITY_5_0 || UNITY_5_1 || UNITY_5_2 || UNITY_5_3
        OnLevelWasLoaded(0);
        #else
        ActivateSurroundings();
        SceneManager.sceneLoaded += OnLevelLoaded;
        #endif
    }