This commit is contained in:
MuHua-123
2025-08-01 17:40:42 +08:00
parent 2b1c4cc36b
commit f249f16f1f
14 changed files with 155 additions and 13 deletions
-1
View File
@@ -1,6 +1,5 @@
using System.Collections;
using System.Collections.Generic;
using UnityEditor.EditorTools;
using UnityEngine;
/// <summary>
@@ -1,8 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Palmmedia.ReportGenerator.Core;
using Unity.VisualScripting;
using UnityEngine;
/// <summary>
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ed61f5627e04e114eb2c086ae01dc7b4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+18
View File
@@ -0,0 +1,18 @@
{
"name": "ModuleEditor",
"rootNamespace": "",
"references": [
"GUID:432b70115e987f44abb984cfe7de384f"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 779534da92936794a829f8bf18309372
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+27
View File
@@ -0,0 +1,27 @@
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
public class TestEditorWindow : EditorWindow {
[SerializeField]
private VisualTreeAsset m_VisualTreeAsset = default;
[MenuItem("Window/MuHua/TestEditorWindow")]
public static void ShowExample() {
TestEditorWindow wnd = GetWindow<TestEditorWindow>();
wnd.titleContent = new GUIContent("TestEditorWindow");
}
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);
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: ccbcb6aee5874ac4ba30fcb269d7c7ba
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences:
- m_VisualTreeAsset: {fileID: 9197481963319205126, guid: d23b67a16b48c2243aabe57056dbfbed, type: 3}
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7b3aa5ae52050524d8a9e0de714dd75c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,5 @@
.custom-label {
font-size: 20px;
-unity-font-style: bold;
color: rgb(68, 138, 255);
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e4abceb9650918a419c073e86d8fc3d6
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
disableValidation: 0
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<engine:UXML
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:engine="UnityEngine.UIElements"
xmlns:editor="UnityEditor.UIElements"
xsi:noNamespaceSchemaLocation="../../../UIElementsSchema/UIElements.xsd"
>
<Style src="project://database/Assets/UI%20Toolkit/EditorWindow/TestEditorWindow.uss?fileID=7433441132597879392&amp;guid=e4abceb9650918a419c073e86d8fc3d6&amp;type=3#TestEditorWindow" />
<engine:Label text="Hello World! From UXML" />
<engine:Label class="custom-label" text="Hello World! With Style" />
</engine:UXML>
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: d23b67a16b48c2243aabe57056dbfbed
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -4,7 +4,7 @@
UnityConnectSettings:
m_ObjectHideFlags: 0
serializedVersion: 1
m_Enabled: 0
m_Enabled: 1
m_TestMode: 0
m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events
m_EventUrl: https://cdp.cloud.unity3d.com/v1/events