private void Awake() { if (_instance == null) { _instance = this; DontDestroyOnLoad(gameObject); } else if (_instance == this) { DontDestroyOnLoad(gameObject); } else { DestroyImmediate(gameObject); return; } mixer = hDatabase.current.audioMixerGroup; if (_audioController == null) { _audioController = new hAudioController(gameObject); } //Play(); }
public void Stop() { if (_audioController == null) { _audioController = new hAudioController(gameObject); } _audioController.Stop(); if (mixer == null) { mixer = hDatabase.current.audioMixerGroup; } mixer.audioMixer.SetFloat("Master", -80f); }
public void Play() { if (mixer == null) { mixer = hDatabase.current.audioMixerGroup; } mixer.audioMixer.SetFloat("Master", 0f); if (_audioController == null) { _audioController = new hAudioController(gameObject); } if (_audioController.isPause || _audioController.isPlaying) { return; } _audioController.Play(_bgmClip, 1, true); }