lilxyzw / lilEditorToolbox

MIT License
15 stars 0 forks source link

Icon Overlay Editorで新規リストを追加するたびにエラーが発生する #14

Closed c-colloid closed 4 weeks ago

c-colloid commented 1 month ago

リストを追加すると一つ上の要素をコピーしてしまう為、同じKeyへのアクセスが発生してエラーが返されます

エラー内容

ArgumentException: An item with the same key has already been added. Key: cbc5b38700a5cc04c87963268933e656
System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <27124aa0e30a41659b903b822b959bc7>:0)
System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) (at <27124aa0e30a41659b903b822b959bc7>:0)
System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] keySelector, System.Func`2[T,TResult] elementSelector, System.Collections.Generic.IEqualityComparer`1[T] comparer) (at <70471b9615aa4ecfa3ed1abb95b73832>:0)
System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] keySelector, System.Func`2[T,TResult] elementSelector) (at <70471b9615aa4ecfa3ed1abb95b73832>:0)
jp.lilxyzw.editortoolbox.IconOverlayData.InitDic () (at ./Packages/jp.lilxyzw.editortoolbox/Editor/ProjectExtension/Components/IconOverlay.cs:39)
jp.lilxyzw.editortoolbox.IconOverlayData+IconOverlayEditor.OnGUI () (at ./Packages/jp.lilxyzw.editortoolbox/Editor/ProjectExtension/Components/IconOverlay.cs:108)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition) (at <80a8ce1980c648dca8e68f0d8aa3b930>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect dockAreaRect) (at <80a8ce1980c648dca8e68f0d8aa3b930>:0)
UnityEditor.DockArea.OldOnGUI () (at <80a8ce1980c648dca8e68f0d8aa3b930>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <332857d8803a4878904bcf8f9581ec33>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <332857d8803a4878904bcf8f9581ec33>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <332857d8803a4878904bcf8f9581ec33>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <332857d8803a4878904bcf8f9581ec33>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <332857d8803a4878904bcf8f9581ec33>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <332857d8803a4878904bcf8f9581ec33>:0)
UnityEngine.UIElements.IMGUIContainer.ProcessEvent (UnityEngine.UIElements.EventBase evt) (at <332857d8803a4878904bcf8f9581ec33>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <332857d8803a4878904bcf8f9581ec33>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtCurrentTargetAndPhase (UnityEngine.UIElements.EventBase evt) (at <332857d8803a4878904bcf8f9581ec33>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <332857d8803a4878904bcf8f9581ec33>:0)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <332857d8803a4878904bcf8f9581ec33>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <332857d8803a4878904bcf8f9581ec33>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <332857d8803a4878904bcf8f9581ec33>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <332857d8803a4878904bcf8f9581ec33>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <332857d8803a4878904bcf8f9581ec33>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <332857d8803a4878904bcf8f9581ec33>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <332857d8803a4878904bcf8f9581ec33>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <332857d8803a4878904bcf8f9581ec33>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <332857d8803a4878904bcf8f9581ec33>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <332857d8803a4878904bcf8f9581ec33>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <332857d8803a4878904bcf8f9581ec33>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <332857d8803a4878904bcf8f9581ec33>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <332857d8803a4878904bcf8f9581ec33>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <74d6aaa3aedf4a279751914e170fef65>:0)