void unloadSoundMarkerAndSyncedClips(SoundMarker marker, IEnumerable <SoundMarker> syncedMarkers) { SoundFile markerSF = marker.hotspot.soundFile; if (!markerSF.isDefaultSoundFile && (markerSF.loadState == LoadState.Success || markerSF.clip != null)) { // Unload the first marker // marker.SetAudioPauseState(true); marker.OnDemandNullifyAudioClip(); if (destroyImmediate) { UnityEngine.GameObject.DestroyImmediate(markerSF.clip, allowDestroyingAssets: false); } else { UnityEngine.GameObject.Destroy(markerSF.clip); } markerSF.clip = null; markerSF.loadState = LoadState.NotLoaded; } // - - - - - - - - - - - - - - - - - - - // Unload Synced Markers if (syncedMarkers != null) { foreach (SoundMarker syncedMarker in syncedMarkers) { SoundFile syncedSF = syncedMarker.hotspot.soundFile; if (!syncedSF.isDefaultSoundFile && (syncedSF.loadState == LoadState.Success || syncedSF.clip != null)) { // syncedMarker.SetAudioPauseState(true); syncedMarker.OnDemandNullifyAudioClip(); if (destroyImmediate) { UnityEngine.GameObject.DestroyImmediate(syncedSF.clip, allowDestroyingAssets: false); } else { UnityEngine.GameObject.Destroy(syncedSF.clip); } syncedSF.clip = null; syncedSF.loadState = LoadState.NotLoaded; } } } // - - - - - - - - - - - - - - - - - - - _managerDelegate?.OnDemandLoadingLoadedAudioClipsChanged(this); }