Exemplo n.º 1
0
    void Start()
    {
        audio = GetComponent <AudioSource> ();

        GameObject settings = GameObject.FindGameObjectWithTag("musicVol");

        musicSett = (musicSettings)settings.GetComponent(typeof(musicSettings));
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        audio = GetComponent <AudioSource> ();
        GameObject settings = GameObject.FindGameObjectWithTag("musicVol");

        musicSett    = (musicSettings)settings.GetComponent(typeof(musicSettings));
        audio.volume = musicSett.GetMusicVolume();

        player = GameObject.FindGameObjectWithTag("Player");
    }
Exemplo n.º 3
0
 void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }