質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.46%
Unity

Unityは、Unity Technologiesが開発・販売している、IDEを内蔵するゲームエンジンです。主にC#を用いたプログラミングでコンテンツの開発が可能です。

Q&A

0回答

1190閲覧

UXMLファイルを作成しようとするとエラーが出ます。

satokun

総合スコア0

Unity

Unityは、Unity Technologiesが開発・販売している、IDEを内蔵するゲームエンジンです。主にC#を用いたプログラミングでコンテンツの開発が可能です。

0グッド

0クリップ

投稿2020/06/08 11:13

前提・実現したいこと

エディタ上で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.Dictionary2[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.Dictionary2[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.Dictionary2[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.EventCallbackFunctor1[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で共に同じエラーであることを確認。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.46%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問