static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) { foreach (string str in importedAssets) { if (str.EndsWith(@".fev")) { if (File.Exists(str + @".asset")) { FmodEventAsset newAsset = FmodEventAsset.CreateInstance("FmodEventAsset") as FmodEventAsset; FmodEventAsset oldAsset = AssetDatabase.LoadAssetAtPath(str + @".asset", typeof(FmodEventAsset)) as FmodEventAsset; newAsset.Initialize(str); UpdateEventAsset(oldAsset, newAsset); newAsset.CreateAsset(str); AssetDatabase.SaveAssets(); CheckForRemainsOfDeletedParameters(); FmodEventSystem.ClearHolder(); } else { FmodEventAsset asset = FmodEventAsset.CreateInstance("FmodEventAsset") as FmodEventAsset; asset.Initialize(str); asset.CreateAsset(str); FmodEventSystem.ClearHolder(); } } else if (Application.isPlaying && Application.isEditor && (str.EndsWith(@".cs") || str.EndsWith(@".js"))) { #if UNITY_EDITOR EditorApplication.isPlaying = false; // we are forced to stop the application in the editor at this point, or else Mono will rebuild the app and we'll lose the managed memory. Unfortunately, the C++ application will still be running and we won't be able to come back. Debug.LogWarning("FMOD_Unity : Forced to leave the application because source code was about to be built"); #endif } } }