From b0fd6d5d464b02dfdc9011a7d1304190216fe1d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elfi=20K=C3=BChndorf?= Date: Thu, 30 May 2024 16:41:42 +0200 Subject: [PATCH 01/19] first draft of UIToolkit check uxml for current look --- .../Assets/Common/Prefabs/UI.prefab | 50 + .../Assets/Common/Prefabs/UI.prefab.meta | 7 + .../Assets/Editor/UseCasePanelSettings.asset | 38 + .../Editor/UseCasePanelSettings.asset.meta | 8 + .../Assets/Editor/UseCasesUIToolkitEditor.cs | 30 + .../Editor/UseCasesUIToolkitEditor.cs.meta | 12 + .../Editor/UseCasesUIToolkitEditor.uxml | 11 + .../Editor/UseCasesUIToolkitEditor.uxml.meta | 10 + .../Fonts/LiberationSans SDF.asset | 3640 +++++++++++++++++ .../Fonts/LiberationSans SDF.asset.meta | 8 + .../Assets/UI Toolkit.meta | 8 + .../Assets/UI Toolkit/UnityThemes.meta | 8 + .../UnityThemes/UnityDefaultRuntimeTheme.tss | 1 + .../UnityDefaultRuntimeTheme.tss.meta | 11 + .../Assets/UseCasesStyleClass.uss | 42 + .../Assets/UseCasesStyleClass.uss.meta | 11 + .../UIElementsSchema/GlobalNamespace.xsd | 48 + .../UIElementsSchema/UIElements.xsd | 18 + ...ltiplayer.Tools.NetworkProfiler.Editor.xsd | 40 + .../Unity.Profiling.Editor.xsd | 123 + ...y.Services.Core.Editor.Environments.UI.xsd | 25 + .../UIElementsSchema/Unity.UI.Builder.xsd | 975 +++++ .../UnityEditor.Experimental.GraphView.xsd | 66 + .../UIElementsSchema/UnityEditor.Overlays.xsd | 50 + ...UnityEditor.PackageManager.UI.Internal.xsd | 606 +++ .../UnityEditor.Rendering.LookDev.xsd | 50 + .../UIElementsSchema/UnityEditor.Search.xsd | 28 + .../UnityEditor.ShaderGraph.Drawing.xsd | 51 + .../UnityEditor.ShortcutManagement.xsd | 46 + .../UnityEditor.UIElements.Debugger.xsd | 25 + .../UnityEditor.UIElements.xsd | 567 +++ .../UnityEngine.UIElements.xsd | 1459 +++++++ 32 files changed, 8072 insertions(+) create mode 100644 Experimental/MultiplayerUseCases/Assets/Common/Prefabs/UI.prefab create mode 100644 Experimental/MultiplayerUseCases/Assets/Common/Prefabs/UI.prefab.meta create mode 100644 Experimental/MultiplayerUseCases/Assets/Editor/UseCasePanelSettings.asset create mode 100644 Experimental/MultiplayerUseCases/Assets/Editor/UseCasePanelSettings.asset.meta create mode 100644 Experimental/MultiplayerUseCases/Assets/Editor/UseCasesUIToolkitEditor.cs create mode 100644 Experimental/MultiplayerUseCases/Assets/Editor/UseCasesUIToolkitEditor.cs.meta create mode 100644 Experimental/MultiplayerUseCases/Assets/Editor/UseCasesUIToolkitEditor.uxml create mode 100644 Experimental/MultiplayerUseCases/Assets/Editor/UseCasesUIToolkitEditor.uxml.meta create mode 100644 Experimental/MultiplayerUseCases/Assets/TextMesh Pro/Fonts/LiberationSans SDF.asset create mode 100644 Experimental/MultiplayerUseCases/Assets/TextMesh Pro/Fonts/LiberationSans SDF.asset.meta create mode 100644 Experimental/MultiplayerUseCases/Assets/UI Toolkit.meta create mode 100644 Experimental/MultiplayerUseCases/Assets/UI Toolkit/UnityThemes.meta create mode 100644 Experimental/MultiplayerUseCases/Assets/UI Toolkit/UnityThemes/UnityDefaultRuntimeTheme.tss create mode 100644 Experimental/MultiplayerUseCases/Assets/UI Toolkit/UnityThemes/UnityDefaultRuntimeTheme.tss.meta create mode 100644 Experimental/MultiplayerUseCases/Assets/UseCasesStyleClass.uss create mode 100644 Experimental/MultiplayerUseCases/Assets/UseCasesStyleClass.uss.meta create mode 100644 Experimental/MultiplayerUseCases/UIElementsSchema/GlobalNamespace.xsd create mode 100644 Experimental/MultiplayerUseCases/UIElementsSchema/UIElements.xsd create mode 100644 Experimental/MultiplayerUseCases/UIElementsSchema/Unity.Multiplayer.Tools.NetworkProfiler.Editor.xsd create mode 100644 Experimental/MultiplayerUseCases/UIElementsSchema/Unity.Profiling.Editor.xsd create mode 100644 Experimental/MultiplayerUseCases/UIElementsSchema/Unity.Services.Core.Editor.Environments.UI.xsd create mode 100644 Experimental/MultiplayerUseCases/UIElementsSchema/Unity.UI.Builder.xsd create mode 100644 Experimental/MultiplayerUseCases/UIElementsSchema/UnityEditor.Experimental.GraphView.xsd create mode 100644 Experimental/MultiplayerUseCases/UIElementsSchema/UnityEditor.Overlays.xsd create mode 100644 Experimental/MultiplayerUseCases/UIElementsSchema/UnityEditor.PackageManager.UI.Internal.xsd create mode 100644 Experimental/MultiplayerUseCases/UIElementsSchema/UnityEditor.Rendering.LookDev.xsd create mode 100644 Experimental/MultiplayerUseCases/UIElementsSchema/UnityEditor.Search.xsd create mode 100644 Experimental/MultiplayerUseCases/UIElementsSchema/UnityEditor.ShaderGraph.Drawing.xsd create mode 100644 Experimental/MultiplayerUseCases/UIElementsSchema/UnityEditor.ShortcutManagement.xsd create mode 100644 Experimental/MultiplayerUseCases/UIElementsSchema/UnityEditor.UIElements.Debugger.xsd create mode 100644 Experimental/MultiplayerUseCases/UIElementsSchema/UnityEditor.UIElements.xsd create mode 100644 Experimental/MultiplayerUseCases/UIElementsSchema/UnityEngine.UIElements.xsd diff --git a/Experimental/MultiplayerUseCases/Assets/Common/Prefabs/UI.prefab b/Experimental/MultiplayerUseCases/Assets/Common/Prefabs/UI.prefab new file mode 100644 index 000000000..e517fe011 --- /dev/null +++ b/Experimental/MultiplayerUseCases/Assets/Common/Prefabs/UI.prefab @@ -0,0 +1,50 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &6992812452127128618 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4183923682644896075} + - component: {fileID: 4429985340320126427} + m_Layer: 0 + m_Name: UI + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4183923682644896075 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6992812452127128618} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &4429985340320126427 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6992812452127128618} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 19102, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_PanelSettings: {fileID: 11400000, guid: bb97c42b0da64184d8f6ef64e0c20845, type: 2} + m_ParentUI: {fileID: 0} + sourceAsset: {fileID: 9197481963319205126, guid: 54eac630072f2954eab32aa476089063, type: 3} + m_SortingOrder: 1 diff --git a/Experimental/MultiplayerUseCases/Assets/Common/Prefabs/UI.prefab.meta b/Experimental/MultiplayerUseCases/Assets/Common/Prefabs/UI.prefab.meta new file mode 100644 index 000000000..75c1dad8f --- /dev/null +++ b/Experimental/MultiplayerUseCases/Assets/Common/Prefabs/UI.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 383ab3ebdcb1fc046936a04b13ce157d +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/MultiplayerUseCases/Assets/Editor/UseCasePanelSettings.asset b/Experimental/MultiplayerUseCases/Assets/Editor/UseCasePanelSettings.asset new file mode 100644 index 000000000..75cf6ea12 --- /dev/null +++ b/Experimental/MultiplayerUseCases/Assets/Editor/UseCasePanelSettings.asset @@ -0,0 +1,38 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 19101, guid: 0000000000000000e000000000000000, type: 0} + m_Name: UseCasePanelSettings + m_EditorClassIdentifier: + themeUss: {fileID: -4733365628477956816, guid: 8a3f91c52b0d3e145b3b0f55f26427f3, type: 3} + m_TargetTexture: {fileID: 0} + m_ScaleMode: 0 + m_ReferenceSpritePixelsPerUnit: 100 + m_Scale: 1 + m_ReferenceDpi: 96 + m_FallbackDpi: 96 + m_ReferenceResolution: {x: 1200, y: 800} + m_ScreenMatchMode: 0 + m_Match: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 + m_ClearDepthStencil: 1 + m_ClearColor: 0 + m_ColorClearValue: {r: 0, g: 0, b: 0, a: 0} + m_DynamicAtlasSettings: + m_MinAtlasSize: 64 + m_MaxAtlasSize: 4096 + m_MaxSubTextureSize: 64 + m_ActiveFilters: -1 + m_AtlasBlitShader: {fileID: 9101, guid: 0000000000000000f000000000000000, type: 0} + m_RuntimeShader: {fileID: 9100, guid: 0000000000000000f000000000000000, type: 0} + m_RuntimeWorldShader: {fileID: 9102, guid: 0000000000000000f000000000000000, type: 0} + textSettings: {fileID: 0} diff --git a/Experimental/MultiplayerUseCases/Assets/Editor/UseCasePanelSettings.asset.meta b/Experimental/MultiplayerUseCases/Assets/Editor/UseCasePanelSettings.asset.meta new file mode 100644 index 000000000..b0789c64f --- /dev/null +++ b/Experimental/MultiplayerUseCases/Assets/Editor/UseCasePanelSettings.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bb97c42b0da64184d8f6ef64e0c20845 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/MultiplayerUseCases/Assets/Editor/UseCasesUIToolkitEditor.cs b/Experimental/MultiplayerUseCases/Assets/Editor/UseCasesUIToolkitEditor.cs new file mode 100644 index 000000000..c32b0dfe2 --- /dev/null +++ b/Experimental/MultiplayerUseCases/Assets/Editor/UseCasesUIToolkitEditor.cs @@ -0,0 +1,30 @@ +using UnityEditor; +using UnityEngine; +using UnityEngine.UIElements; + +public class UseCasesUIToolkitEditor : EditorWindow +{ + [SerializeField] + private VisualTreeAsset m_VisualTreeAsset = default; + + [MenuItem("Window/UI Toolkit/UseCasesUIToolkitEditor")] + public static void ShowExample() + { + UseCasesUIToolkitEditor wnd = GetWindow(); + wnd.titleContent = new GUIContent("UseCasesUIToolkitEditor"); + } + + public void CreateGUI() + { + // Each editor window contains a root VisualElement object + VisualElement root = rootVisualElement; + + // VisualElements objects can contain other VisualElement following a tree hierarchy. + VisualElement label = new Label("Hello World! From C#"); + root.Add(label); + + // Instantiate UXML + VisualElement labelFromUXML = m_VisualTreeAsset.Instantiate(); + root.Add(labelFromUXML); + } +} diff --git a/Experimental/MultiplayerUseCases/Assets/Editor/UseCasesUIToolkitEditor.cs.meta b/Experimental/MultiplayerUseCases/Assets/Editor/UseCasesUIToolkitEditor.cs.meta new file mode 100644 index 000000000..0191fced7 --- /dev/null +++ b/Experimental/MultiplayerUseCases/Assets/Editor/UseCasesUIToolkitEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b9fe49b7cd587aa47955a13b7453c71c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - m_VisualTreeAsset: {fileID: 9197481963319205126, guid: 54eac630072f2954eab32aa476089063, type: 3} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Experimental/MultiplayerUseCases/Assets/Editor/UseCasesUIToolkitEditor.uxml b/Experimental/MultiplayerUseCases/Assets/Editor/UseCasesUIToolkitEditor.uxml new file mode 100644 index 000000000..5711c6ac7 --- /dev/null +++ b/Experimental/MultiplayerUseCases/Assets/Editor/UseCasesUIToolkitEditor.uxml @@ -0,0 +1,11 @@ + +