Esempio n. 1
0
 private void Assignations()
 {
     _noDestroy  = FindObjectOfType <NoDestroy>();
     _control    = FindObjectOfType <FlightControl>();
     _sound      = GetComponent <SoundManager>();
     _transition = FindObjectOfType <TransitionControl>();
 }
Esempio n. 2
0
 private void Assignations()
 {
     _noDestroy = FindObjectOfType <NoDestroy>();
     _musicAu   = gameObject.AddComponent <AudioSource>();
     _soundsAu  = gameObject.AddComponent <AudioSource>();
     _uiManager = FindObjectOfType <UIManager>();
     _control   = FindObjectOfType <FlightControl>();
 }
Esempio n. 3
0
    void Awake()
    {
        if (instance != null)
        {
            Destroy(gameObject);
        }

        else
        {
            instance = this;
            DontDestroyOnLoad(gameObject);
        }
    }
Esempio n. 4
0
    private void Awake()
    {
        DontDestroyOnLoad(gameObject);

        if (_instance != null)
        {
            Destroy(gameObject);
        }
        else
        {
            _instance = this;
            GameObject.DontDestroyOnLoad(gameObject);
        }
    }
Esempio n. 5
0
    void OnLevelWasLoaded()
    {
        if (Application.loadedLevelName != "GameOver" || Application.loadedLevelName != "Credits")
        {
            if (nod == null)
            {
                nod = this;
                DontDestroyOnLoad(transform.gameObject);
            }
            else
            {
                if (nod != this)
                {
                    Destroy(this.gameObject);
                }
            }
        }

        if (Application.loadedLevel == 0 || Application.loadedLevel == 1 || Application.loadedLevelName == "Credits")
        {
            Destroy(this.gameObject);
        }
    }