private void MaybeUnloadClip()
        {
            VarAudio.Stop();
            VarAudio.time = 0f;

            switch (audLocation)
            {
            case MasterAudio.AudioLocation.ResourceFile:
                AudioResourceOptimizer.UnloadClipIfUnused(_resFileName);
                break;

            case MasterAudio.AudioLocation.Clip:
                AudioUtil.UnloadNonPreloadedAudioData(VarAudio.clip, GameObj);
                break;

#if ADDRESSABLES_ENABLED
            case MasterAudio.AudioLocation.Addressable:
                VarAudio.clip = null;     // must clear out clip so it can be released below.
                AudioAddressableOptimizer.RemoveAddressablePlayingClip(audioClipAddressable, VarAudio, _isWarmingPlay);
                break;
#endif
            }

            LoadStatus = MasterAudio.VariationLoadStatus.None;
        }
示例#2
0
        private void MaybeUnloadClip()
        {
            if (audLocation == MasterAudio.AudioLocation.ResourceFile)
            {
                AudioResourceOptimizer.UnloadClipIfUnused(_resFileName);
            }

            AudioUtil.UnloadNonPreloadedAudioData(VarAudio.clip, GameObj);
        }