public static ReverbSettings SaveSettings(ReverbSettings toSave) { if (toSave != null) { ReverbSettings newSettings = ReverbSettings.Create(toSave); GlobalReverbZone globalReverb = GameObject.FindObjectOfType(typeof(GlobalReverbZone)) as GlobalReverbZone; newSettings.beforeSerializePresets(); #if UNITY_EDITOR string settingsAssetPath = ReverbSettings.GetSettingsAssetPath(); if (AssetDatabase.Contains(toSave) == true) { AssetDatabase.DeleteAsset(settingsAssetPath); } AssetDatabase.CreateAsset(newSettings, settingsAssetPath); AssetDatabase.SaveAssets(); if (globalReverb != null) { newSettings.afterDeserializePresets(); globalReverb.settings = newSettings; LOADED_REVERB_SETTINGS = globalReverb.settings; if (EditorApplication.isPlaying || EditorApplication.isPaused) { FmodEventSystem.GetReverbManager().UpdateGlobalReverb(); } } #endif } else { Debug.LogError("FMOD_Unity: ReverbSettings: Null reverb settings"); } return(LOADED_REVERB_SETTINGS); }