Beispiel #1
0
    void Awake()
    {
        Instance = this;

        m_audioSource = GetComponent<AudioSource>();

        InitAudioSource();

        SoundManager.Instance.ChangedSound += new OnSound(ChangeSound);
        
    }
Beispiel #2
0
 private void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }
Beispiel #3
0
    void Awake()
    {
        bgAudio.gameObject.GetComponent <AudioSource>();
        if (instance != null && instance != this)
        {
            Destroy(this.gameObject);
            return;
        }
        else
        {
            instance = this;
        }

        DontDestroyOnLoad(this.gameObject);
    }
Beispiel #4
0
 public void PlayBGSound(BGSound _BGSound)
 {
     StopCoroutine("PlaySoundBGRoutine");
     audioSources[0].clip = backGroundClips[(int)_BGSound];
     StartCoroutine("PlaySoundBGRoutine");
 }