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

        m_audioSource = GetComponent<AudioSource>();

        InitAudioSource();

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

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