FMOD:清理重复平台警告

FMOD: Cleaning up duplicate platform warning

FMOD for Unity 2.01.07(Unity 2019.4.18f1 - 运行ning on MacOS Catalina)似乎破坏了他们的 FMODStudioSettings class.

我无法在没有收到这些错误的情况下在编辑器中保存:

FMOD: Cleaning up duplicate platform: ID  = playInEditor, name = 'Play In Editor Settings', type = PlatformPlayInEditor
ArgumentException: An item with the same key has already been added. Key: playInEditor
FMOD: Cleaning up duplicate platform: ID  = default, name = 'Default Settings', type = PlatformDefault
ArgumentException: An item with the same key has already been added. Key: default
NullReferenceException: Object reference not set to an instance of an object
FMODUnity.SettingsEditor.DisplayPlugins (System.String title, FMODUnity.Platform platform, FMODUnity.Platform+PropertyAccessor`1[T] property, System.Collections.Generic.Dictionary`2[TKey,TValue] expandState, System.String warning) (at Assets/Plugins/FMOD/src/Editor/SettingsEditor.cs:1028)

我认为这是一种回归,基本上使 Unity 集成无法使用。与平台地图中的重复数据删除平台有关。在 运行 时间有一系列与平台相关的 NPE,所以实际上我无法 运行 正常玩游戏。还有其他人 运行 参与其中吗?

我正在评估 FMOD 作为我们游戏的中间件选项,并且 运行 Unity 集成中存在至少两个严重错误。 See other bug here.

更新:

我还没有找到为什么这不会发生在每个人身上,但是对于其他 运行 解决这个问题的人来说,一个简单的解决方法就是应用这个差异:

diff --git a/Assets/Plugins/FMOD/src/Runtime/Settings.cs b/Assets/Plugins/FMOD/src/Runtime/Settings.cs
index 2641e926..c2843145 100644
--- a/Assets/Plugins/FMOD/src/Runtime/Settings.cs
+++ b/Assets/Plugins/FMOD/src/Runtime/Settings.cs
@@ -817,6 +817,10 @@ namespace FMODUnity
 
         private void PopulatePlatformsFromAsset()
         {
+            Platforms.Clear();
+            PlatformForBuildTarget.Clear();
+            PlatformForRuntimePlatform.Clear();
+
 #if UNITY_EDITOR
             string assetPath = AssetDatabase.GetAssetPath(this);
             UnityEngine.Object[] assets = AssetDatabase.LoadAllAssetsAtPath(assetPath);
@@ -827,36 +831,8 @@ namespace FMODUnity
 
             foreach (Platform newPlatform in assetPlatforms)
             {
-                Platform existingPlatform = FindPlatform(newPlatform.Identifier);
-
-                if (existingPlatform != null)
-                {
-                    // Duplicate platform; clean one of them up
-                    Platform platformToDestroy;
-
-                    if (newPlatform.Active && !existingPlatform.Active)
-                    {
-                        Platforms.Remove(existingPlatform.Identifier);
-
-                        platformToDestroy = existingPlatform;
-                        existingPlatform = null;
-                    }
-                    else
-                    {
-                        platformToDestroy = newPlatform;
-                    }
-
-                    Debug.LogWarningFormat("FMOD: Cleaning up duplicate platform: ID  = {0}, name = '{1}', type = {2}",
-                        platformToDestroy.Identifier, platformToDestroy.DisplayName, platformToDestroy.GetType().Name);
-
-                    DestroyImmediate(platformToDestroy, true);
-                }
-
-                if (existingPlatform == null)
-                {
-                    newPlatform.EnsurePropertiesAreValid();
-                    Platforms.Add(newPlatform.Identifier, newPlatform);
-                }
+                newPlatform.EnsurePropertiesAreValid();
+                Platforms.Add(newPlatform.Identifier, newPlatform);
             }
 
 #if UNITY_EDITOR

所以这是他们在 2.01.10 中修复的集成错误。