Ejemplo n.º 1
0
    private void Start()
    {
        fader = GameObject.FindGameObjectWithTag("Fader").GetComponent <FaderController>();

        if (!pauseMenu)
        {
            helpScreen = GameObject.FindGameObjectWithTag("HelpScreen").GetComponent <HelpScreenController>();
        }
    }
    void Start()
    {
        GameObject m_obj   = GameObject.Instantiate(fader);
        GameObject sfx_obj = GameObject.Instantiate(serialPlayer);

        this.music_player = m_obj.GetComponent <FaderController>();
        this.sfx_player   = sfx_obj.GetComponent <SerialPlayerController>();

        m_obj.transform.SetParent(this.transform);
        sfx_obj.transform.SetParent(this.transform);
    }
 void GetOrCreateSingleton()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
 }