+1 支持
(160 ポイント)

MacにてUnityの再生を一回でも行うと、

それ以降コンポーネントの追加ができなくなります。

下記のエラーが発生するのはなぜですか?

※全インポートをやり直すと、動作するようになります。

ArgumentException: An item with the same key has already been added. Key: Component/Monobit Networking Support/Monobit Auto Login Template

System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)

System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)

UnityEditor.AdvancedDropdown.AddComponentDataSource.GetMenuDictionary () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/AddComponent/AddComponentDataSource.cs:70)

UnityEditor.AdvancedDropdown.AddComponentDataSource.RebuildTree () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/AddComponent/AddComponentDataSource.cs:17)

UnityEditor.AdvancedDropdown.AddComponentDataSource.FetchData () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/AddComponent/AddComponentDataSource.cs:10)

UnityEditor.AdvancedDropdown.AdvancedDropdownDataSource.ReloadData () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/AdvancedDropdown/AdvancedDropdownDataSource.cs:22)

UnityEditor.AdvancedDropdown.AdvancedDropdownWindow.OnDirtyList () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/AdvancedDropdown/AdvancedDropdownWindow.cs:202)

UnityEditor.AdvancedDropdown.AdvancedDropdownWindow.Init (UnityEngine.Rect buttonRect) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/AdvancedDropdown/AdvancedDropdownWindow.cs:95)

UnityEditor.AdvancedDropdown.AdvancedDropdownWindow.CreateAndInit[T] (UnityEngine.Rect rect) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/AdvancedDropdown/AdvancedDropdownWindow.cs:79)

UnityEditor.AdvancedDropdown.AddComponentWindow.Show (UnityEngine.Rect rect, UnityEngine.GameObject[] gos) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/AddComponent/AddComponentWindow.cs:68)

UnityEditor.InspectorWindow.AddComponentButton (UnityEditor.Editor[] editors) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1807)

UnityEditor.InspectorWindow.OnGUI () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:680)

System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)

Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.

System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)

System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)

UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:342)

UnityEditor.HostView.Invoke (System.String methodName) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:336)

UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:310)

UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect, System.Boolean customBorder, System.Boolean floatingWindow, System.Boolean isBottomTab) (at /Users/builduser/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:361)

UnityEditor.DockArea.OldOnGUI () (at /Users/builduser/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:320)

UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:266)

UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:438)

UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:421)

UnityEngine.Experimental.UIElements.IMGUIContainer.HandleEvent (UnityEngine.Experimental.UIElements.EventBase evt) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:401)

UnityEngine.Experimental.UIElements.EventDispatcher.PropagateEvent (UnityEngine.Experimental.UIElements.EventBase evt) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:754)

UnityEngine.Experimental.UIElements.EventDispatcher.ProcessEvent (UnityEngine.Experimental.UIElements.EventBase evt, UnityEngine.Experimental.UIElements.IPanel panel) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:599)

UnityEngine.Experimental.UIElements.EventDispatcher.Dispatch (UnityEngine.Experimental.UIElements.EventBase evt, UnityEngine.Experimental.UIElements.IPanel panel, UnityEngine.Experimental.UIElements.DispatchMode dispatchMode) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:307)

UnityEngine.Experimental.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.Experimental.UIElements.EventBase e, UnityEngine.Experimental.UIElements.DispatchMode dispatchMode) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/Panel.cs:176)

UnityEngine.Experimental.UIElements.UIElementsUtility.DoDispatch (UnityEngine.Experimental.UIElements.BaseVisualElementPanel panel) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:245)

UnityEngine.Experimental.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:68)

UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

回答 1

+1 支持
(580 ポイント)
検索かけると、Unity5.1に似たバグがあったそうなので

https://answers.unity.com/questions/983316/monodevelop-error-after-unity-51-upgrade-an-item-w.html

Unityのスクリプトファイルをダブルクリックして、MonoDevelop起動

Assembly-CSharpを右クリックして、Optionを選択

BuildのCompilerの中にある「Define Symbols」の先頭にある「DEBUG;TRACE;」の部分を削除。

で治ったりしないでしょうか?
...