前提・実現したいこと
エディタ上でUI Elementsを自動生成するメニューを実行するとエラーが発生します。
エラーになるのは以下の3パターン。
-Assets/Update UIElementsSchemaを選択した時
-Projectビュー、Editorフォルダ以下でCreate/UIElements/UXML Templet/ を選択した時。
-Projectビュー、Editorフォルダ以下でCreate/UIElements/Editor Windowを選択して、ULElements Editor Window Creatorで適当なファイル名を入力してConfilmを押下した時。
UNITY共通の設定がおかしいのか、又は何らかの初期設定を忘れているのかと疑っているのですが、原因が全くわかりません。
また、ネット上のUXML関連の情報から自力でUXMLファイルを作成しようとしても、困ったこに上記時に自動生成されるUIElements.xsdが作成できません。
エラーの解決か、又は自力でUIElements.xsdファイルを作成する方法がありましたらご提示お願いします。
発生している問題・エラーメッセージ
エラーメッセージ(Update UIElementsSchema選択時)
ArgumentException: An item with the same key has already been added. Key: UnityEditor.U2D.Layout.ScrollableToolbar_isHorizontal_Type
System.Collections.Generic.Dictionary2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <437ba245d8404784b9fbab9b439ac908>:0) System.Collections.Generic.Dictionary
2[TKey,TValue].Add (TKey key, TValue value) (at <437ba245d8404784b9fbab9b439ac908>:0)
UnityEditor.UIElements.UxmlSchemaGenerator.AddAttributeTypeToXmlSchema (UnityEditor.UIElements.UxmlSchemaGenerator+SchemaInfo schemaInfo, UnityEngine.UIElements.UxmlAttributeDescription description, UnityEngine.UIElements.IUxmlFactory factory, UnityEditor.UIElements.UxmlSchemaGenerator+FactoryProcessingHelper processingData) (at <cf7d2c2e83f749e8943578126f9eff4b>:0)
UnityEditor.UIElements.UxmlSchemaGenerator.AddElementTypeToXmlSchema (UnityEngine.UIElements.IUxmlFactory factory, UnityEditor.UIElements.UxmlSchemaGenerator+SchemaInfo schemaInfo, UnityEditor.UIElements.UxmlSchemaGenerator+FactoryProcessingHelper processingData) (at <cf7d2c2e83f749e8943578126f9eff4b>:0)
UnityEditor.UIElements.UxmlSchemaGenerator.ProcessFactory (UnityEngine.UIElements.IUxmlFactory factory, System.Collections.Generic.Dictionary`2[TKey,TValue] schemas, UnityEditor.UIElements.UxmlSchemaGenerator+FactoryProcessingHelper processingData) (at <cf7d2c2e83f749e8943578126f9eff4b>:0)
UnityEditor.UIElements.UxmlSchemaGenerator+<GenerateSchemaFiles>d__12.MoveNext () (at <cf7d2c2e83f749e8943578126f9eff4b>:0)
UnityEditor.UIElements.UxmlSchemaGenerator.UpdateSchemaFiles () (at <cf7d2c2e83f749e8943578126f9eff4b>:0)
UnityEditor.UIElements.UxmlSchemaGenerator.CreateTemplateMenuItem () (at <cf7d2c2e83f749e8943578126f9eff4b>:0)
エラーメッセージ2(UXML Templet選択時)
ArgumentException: An item with the same key has already been added. Key: UnityEditor.U2D.Layout.ScrollableToolbar_isHorizontal_Type
System.Collections.Generic.Dictionary2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <437ba245d8404784b9fbab9b439ac908>:0) System.Collections.Generic.Dictionary
2[TKey,TValue].Add (TKey key, TValue value) (at <437ba245d8404784b9fbab9b439ac908>:0)
UnityEditor.UIElements.UxmlSchemaGenerator.AddAttributeTypeToXmlSchema (UnityEditor.UIElements.UxmlSchemaGenerator+SchemaInfo schemaInfo, UnityEngine.UIElements.UxmlAttributeDescription description, UnityEngine.UIElements.IUxmlFactory factory, UnityEditor.UIElements.UxmlSchemaGenerator+FactoryProcessingHelper processingData) (at <cf7d2c2e83f749e8943578126f9eff4b>:0)
UnityEditor.UIElements.UxmlSchemaGenerator.AddElementTypeToXmlSchema (UnityEngine.UIElements.IUxmlFactory factory, UnityEditor.UIElements.UxmlSchemaGenerator+SchemaInfo schemaInfo, UnityEditor.UIElements.UxmlSchemaGenerator+FactoryProcessingHelper processingData) (at <cf7d2c2e83f749e8943578126f9eff4b>:0)
UnityEditor.UIElements.UxmlSchemaGenerator.ProcessFactory (UnityEngine.UIElements.IUxmlFactory factory, System.Collections.Generic.Dictionary`2[TKey,TValue] schemas, UnityEditor.UIElements.UxmlSchemaGenerator+FactoryProcessingHelper processingData) (at <cf7d2c2e83f749e8943578126f9eff4b>:0)
UnityEditor.UIElements.UxmlSchemaGenerator+<GenerateSchemaFiles>d__12.MoveNext () (at <cf7d2c2e83f749e8943578126f9eff4b>:0)
UnityEditor.UIElements.UxmlSchemaGenerator.UpdateSchemaFiles () (at <cf7d2c2e83f749e8943578126f9eff4b>:0)
UnityEditor.UIElements.UIElementsTemplate.CreateUXMLTemplate (System.String folder, System.String uxmlContent) (at <cf7d2c2e83f749e8943578126f9eff4b>:0)
UnityEditor.UIElements.UIElementsTemplate.CreateUXMLTemplate () (at <cf7d2c2e83f749e8943578126f9eff4b>:0)
エラーメッセージ3 UIElements Editor Windowの決定時
ArgumentException: An item with the same key has already been added. Key: UnityEditor.U2D.Layout.ScrollableToolbar_isHorizontal_Type
System.Collections.Generic.Dictionary2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <437ba245d8404784b9fbab9b439ac908>:0) System.Collections.Generic.Dictionary
2[TKey,TValue].Add (TKey key, TValue value) (at <437ba245d8404784b9fbab9b439ac908>:0)
UnityEditor.UIElements.UxmlSchemaGenerator.AddAttributeTypeToXmlSchema (UnityEditor.UIElements.UxmlSchemaGenerator+SchemaInfo schemaInfo, UnityEngine.UIElements.UxmlAttributeDescription description, UnityEngine.UIElements.IUxmlFactory factory, UnityEditor.UIElements.UxmlSchemaGenerator+FactoryProcessingHelper processingData) (at <cf7d2c2e83f749e8943578126f9eff4b>:0)
UnityEditor.UIElements.UxmlSchemaGenerator.AddElementTypeToXmlSchema (UnityEngine.UIElements.IUxmlFactory factory, UnityEditor.UIElements.UxmlSchemaGenerator+SchemaInfo schemaInfo, UnityEditor.UIElements.UxmlSchemaGenerator+FactoryProcessingHelper processingData) (at <cf7d2c2e83f749e8943578126f9eff4b>:0)
UnityEditor.UIElements.UxmlSchemaGenerator.ProcessFactory (UnityEngine.UIElements.IUxmlFactory factory, System.Collections.Generic.Dictionary2[TKey,TValue] schemas, UnityEditor.UIElements.UxmlSchemaGenerator+FactoryProcessingHelper processingData) (at <cf7d2c2e83f749e8943578126f9eff4b>:0) UnityEditor.UIElements.UxmlSchemaGenerator+<GenerateSchemaFiles>d__12.MoveNext () (at <cf7d2c2e83f749e8943578126f9eff4b>:0) UnityEditor.UIElements.UxmlSchemaGenerator.UpdateSchemaFiles () (at <cf7d2c2e83f749e8943578126f9eff4b>:0) UnityEditor.UIElements.UIElementsTemplate.CreateUXMLTemplate (System.String folder, System.String uxmlContent) (at <cf7d2c2e83f749e8943578126f9eff4b>:0) UnityEditor.UIElements.UIElementsEditorWindowCreator.CreateNewTemplatesFiles () (at <cf7d2c2e83f749e8943578126f9eff4b>:0) UnityEngine.UIElements.Clickable.Invoke (UnityEngine.UIElements.EventBase evt) (at <95b42489e2e04430a87c3760aa29fca2>:0) UnityEngine.UIElements.Clickable.OnMouseUp (UnityEngine.UIElements.MouseUpEvent evt) (at <95b42489e2e04430a87c3760aa29fca2>:0) UnityEngine.UIElements.EventCallbackFunctor
1[TEventType].Invoke (UnityEngine.UIElements.EventBase evt) (at <95b42489e2e04430a87c3760aa29fca2>:0)
UnityEngine.UIElements.EventCallbackRegistry.InvokeCallbacks (UnityEngine.UIElements.EventBase evt) (at <95b42489e2e04430a87c3760aa29fca2>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <95b42489e2e04430a87c3760aa29fca2>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <95b42489e2e04430a87c3760aa29fca2>:0)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <95b42489e2e04430a87c3760aa29fca2>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <95b42489e2e04430a87c3760aa29fca2>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <95b42489e2e04430a87c3760aa29fca2>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <95b42489e2e04430a87c3760aa29fca2>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <95b42489e2e04430a87c3760aa29fca2>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <95b42489e2e04430a87c3760aa29fca2>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <95b42489e2e04430a87c3760aa29fca2>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <95b42489e2e04430a87c3760aa29fca2>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <95b42489e2e04430a87c3760aa29fca2>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <95b42489e2e04430a87c3760aa29fca2>:0)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <95b42489e2e04430a87c3760aa29fca2>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <35bab3c7b0dc4999845bcfccc7758d96>:0)
試したこと
Unity2019.3.14f1、Unity2019.3.15f1(現時点の最新ver)、2020.2.0a13で共に同じエラーであることを確認。
あなたの回答
tips
プレビュー