Exemple #1
0
        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
        }
 public void SetSourceTypeDefaultSettings(AudioController.AudioType type)
 {
     AudioController.SetSourceDefaultSettings(source, type);
 }
 public AudioCaseCustom(AudioClip clip, AudioSource source, AudioController.AudioType type, bool autoRelease) : base(clip, source, type)
 {
     this.autoRelease = autoRelease;
 }