public new void Awake() { base.Awake(); isActive = AudioController.GetSoundVolume() == 1.0f; if (isActive) { graphic.color = activeColor; } else { graphic.color = disableColor; } }
public NativeAudioCase(string fileName, AudioController.AudioType type) { audioName = fileName; audioType = type; #if UNITY_EDITOR AudioController.LoadAudioClipFromStreamingAssets(fileName, OnClipLoaded); #elif UNITY_ANDROID float currentVolume = type == AudioController.AudioType.Sound ? AudioController.GetSoundVolume() : AudioController.GetMusicVolume(); //var adjustment = new NativeAudio.PlayAdjustment { volume = currentVolume, pan = 1f }; //playOptions = new NativeAudio.PlayOptions { playAdjustment = adjustment }; //Debug.Log("Created native audio case for:" + fileName + " volume: " + currentVolume); audioEnabled = currentVolume == 0 ? false : true; nativeAudioPointer = NativeAudio.Load(fileName); #endif }