This commit is contained in:
MuHua-123
2025-02-28 18:28:03 +08:00
parent 5bc834bfcd
commit fb849c9c25
75 changed files with 859 additions and 7 deletions
-3
View File
@@ -1,3 +0,0 @@
.unity-text-element {
-unity-font-definition: url("project://database/Assets/FontLibrary/UIToolkit/SourceHanSansCN-Medium%20SDF.asset?fileID=11400000&guid=500f473f880266d43aaf04a728879085&type=2#SourceHanSansCN-Medium SDF");
}
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6d1bcd63c2c24d540bc4736439c8dc7d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 96a17be56bd1a684388f693fae44f7c9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,9 @@
@import url("unity-theme://default");
@import url("/Assets/MuHua/UITool/FontLibrary/Fonts.uss");
@import url("/Assets/MuHua/UITool/UIScroller/ScrollerHorizontal.uss");
VisualElement {}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 59bfacbee7a859f42904b05799bf9437
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 12388, guid: 0000000000000000e000000000000000, type: 0}
disableValidation: 0
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a5bdaff13d0987148992bf7cc1af29a2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,3 @@
.unity-text-element {
-unity-font-definition: url("project://database/Assets/MuHua/UITool/FontLibrary/SourceHanSansCN-Medium%20SDF.asset?fileID=11400000&guid=500f473f880266d43aaf04a728879085&type=2#SourceHanSansCN-Medium SDF");
}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e7cdf28a5161c094ea27a8b5ad54d741
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,95 @@
.window {
position: absolute;
top: auto;
left: auto;
width: 400px;
height: 300px;
background-color: rgba(0, 0, 0, 0);
border-radius: 10px;
padding: 20px;
display: flex;
flex-direction: column;
opacity: 1;
padding-top: 0;
padding-right: 0;
padding-bottom: 0;
padding-left: 0;
border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.window-top {
justify-content: space-between;
background-color: rgb(44, 62, 80);
border-top-left-radius: 10px;
border-top-right-radius: 10px;
padding-left: 10px;
height: 50px;
flex-direction: row;
flex-shrink: 1;
flex-grow: 0;
align-items: center;
}
.window-title {
font-size: 24px;
color: rgb(236, 240, 241);
margin-bottom: 0;
margin-top: 0;
margin-right: 0;
margin-left: 0;
padding-top: 0;
padding-right: 0;
padding-bottom: 0;
padding-left: 0;
-unity-text-align: middle-left;
}
.window-close-button {
background-color: rgb(231, 76, 60);
color: rgb(236, 240, 241);
border-radius: 5px;
margin-top: 10px;
margin-right: 10px;
margin-bottom: 10px;
margin-left: 10px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
border-top-width: 2px;
border-right-width: 2px;
border-bottom-width: 2px;
border-left-width: 2px;
border-left-color: rgba(0, 0, 0, 0);
border-right-color: rgba(0, 0, 0, 0);
border-top-color: rgba(0, 0, 0, 0);
border-bottom-color: rgba(0, 0, 0, 0);
height: 30px;
}
.window-close-button:hover {
background-color: rgb(192, 57, 43);
border-top-width: 2px;
border-right-width: 2px;
border-bottom-width: 2px;
border-left-width: 2px;
border-left-color: rgb(0, 157, 255);
border-right-color: rgb(0, 157, 255);
border-top-color: rgb(0, 157, 255);
border-bottom-color: rgb(0, 157, 255);
}
.window-container {
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
background-color: rgb(242, 242, 242);
overflow: hidden;
}
.window-hidden {
display: none;
opacity: 0;
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 71fd1505cc1aa1e4297e4f4534cc0124
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
disableValidation: 0
@@ -0,0 +1,10 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
<Style src="project://database/Assets/MuHua/UITool/USS/FloatingWindow.uss?fileID=7433441132597879392&amp;guid=71fd1505cc1aa1e4297e4f4534cc0124&amp;type=3#FloatingWindow" />
<ui:VisualElement name="Window" class="window window-hidden" style="width: 510px; height: auto;">
<ui:VisualElement name="Top" class="window-top">
<ui:Label text="窗口" name="Title" class="window-title" />
<ui:Button name="Close" text="X" class="window-close-button" />
</ui:VisualElement>
<ui:VisualElement name="Container" class="window-container" />
</ui:VisualElement>
</ui:UXML>
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: f58c5527cf4cda147b239b37b0afcb85
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: bebc51f45f54a904a8e07157976da6bb
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d8db2d69206657346a4fe9aebc592327
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
disableValidation: 0
@@ -0,0 +1,4 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
<Style src="project://database/Assets/MuHua/UITool/USS/ScrollView.uss?fileID=7433441132597879392&amp;guid=d8db2d69206657346a4fe9aebc592327&amp;type=3#ScrollView" />
<MuHua.MUScrollViewVertical />
</ui:UXML>
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: e95fad6397f22504eb724a8ea0c8d926
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b0a55937e12435144b4b7c36d1fd6e95
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
disableValidation: 0
@@ -0,0 +1,3 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
<Style src="project://database/Assets/MuHua/UITool/UIScrollView/ScrollViewHorizontal.uss?fileID=7433441132597879392&amp;guid=b0a55937e12435144b4b7c36d1fd6e95&amp;type=3#ScrollViewHorizontal" />
</ui:UXML>
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: ac460a2d93de869499c04a4295795595
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fd72798a2f7a89b4b96b9d8249af66ad
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
disableValidation: 0
@@ -0,0 +1,3 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
<Style src="project://database/Assets/MuHua/UITool/UIScrollView/ScrollViewVertical.uss?fileID=7433441132597879392&amp;guid=fd72798a2f7a89b4b96b9d8249af66ad&amp;type=3#ScrollViewVertical" />
</ui:UXML>
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: a75122cc6293a3d4f9ba44b98f4bed9e
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: bd2ae276ee0cc884cbe88f423b8f35fd
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,11 @@
.scroller-horizontal {
width: 100%;
height: 30px;
background-color: rgb(255, 255, 255);
}
.scroller-horizontal-dragger {
background-color: rgb(255, 126, 126);
width: 30px;
height: 100%;
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fa60433f4fc03c34e8b51e6a8c9b32db
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
disableValidation: 0
@@ -0,0 +1,6 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
<Style src="project://database/Assets/MuHua/UITool/UIScroller/ScrollerHorizontal.uss?fileID=7433441132597879392&amp;guid=fa60433f4fc03c34e8b51e6a8c9b32db&amp;type=3#ScrollerHorizontal" />
<ui:VisualElement name="ScrollerHorizontal" class="scroller-horizontal">
<ui:VisualElement name="Dragger" class="scroller-horizontal-dragger" />
</ui:VisualElement>
</ui:UXML>
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 14902068774d28f4daf1887a57533a75
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
@@ -0,0 +1,11 @@
.vertical-scroller {
width: 30px;
height: 100%;
background-color: rgb(255, 255, 255);
}
.vertical-scroller-dragger {
background-color: rgb(255, 126, 126);
width: 100%;
height: 30px;
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a7fd7497066a90d4cad4bb96a3d9cf68
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
disableValidation: 0
@@ -0,0 +1,8 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
<Style src="project://database/Assets/MuHua/UITool/USS/Scroller.uss?fileID=7433441132597879392&amp;guid=a7fd7497066a90d4cad4bb96a3d9cf68&amp;type=3#Scroller" />
<MuHua.MUScrollerHorizontal />
<MuHua.MUScrollerVertical />
<ui:VisualElement name="ScrollerVertical" style="flex-grow: 1;">
<ui:VisualElement name="Dragger" style="flex-grow: 1;" />
</ui:VisualElement>
</ui:UXML>
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: f1b09f67b8d868f48ae3011621da6b73
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
+66
View File
@@ -122,6 +122,67 @@ NavMeshSettings:
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &36355707
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 36355710}
- component: {fileID: 36355709}
- component: {fileID: 36355708}
m_Layer: 5
m_Name: UIDocument
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &36355708
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 36355707}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 48270532e0731284a92ff8556d892c7e, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &36355709
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 36355707}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 19102, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_PanelSettings: {fileID: 11400000, guid: 4caef6f0e9981084a9e0cbfd447fac06, type: 2}
m_ParentUI: {fileID: 0}
sourceAsset: {fileID: 9197481963319205126, guid: 337d91fd31b0b764f97868cdacc90f66, type: 3}
m_SortingOrder: 0
--- !u!4 &36355710
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 36355707}
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!1 &218982090
GameObject:
m_ObjectHideFlags: 0
@@ -863,6 +924,10 @@ PrefabInstance:
propertyPath: m_Name
value: StandardLabel
objectReference: {fileID: 0}
- target: {fileID: 1923445833930100383, guid: 9df2d2c64a5c06245be7e81572bcfe4e, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
@@ -877,3 +942,4 @@ SceneRoots:
- {fileID: 495038690}
- {fileID: 851831250}
- {fileID: 8592585726815668701}
- {fileID: 36355710}
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 255179b9440614542b26d46561680a31
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+20
View File
@@ -0,0 +1,20 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
using MuHua;
public class TestUI : MonoBehaviour
{
/// <summary> 绑定文档 </summary>
public UIDocument document;
/// <summary> 根目录文档 </summary>
public VisualElement root => document.rootVisualElement;
private UIScrollerHorizontal scroller;
private void Awake()
{
VisualElement Scroller = root.Q<VisualElement>();
scroller = new UIScrollerHorizontal(Scroller, root);
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 48270532e0731284a92ff8556d892c7e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+5
View File
@@ -0,0 +1,5 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
<ui:VisualElement name="ScrollerHorizontal" class="scroller-horizontal" style="width: 300px; position: absolute; left: 50px; top: 50px;">
<ui:VisualElement name="Dragger" class="scroller-horizontal-dragger" />
</ui:VisualElement>
</ui:UXML>
+10
View File
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 337d91fd31b0b764f97868cdacc90f66
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
+1 -1
View File
@@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 19101, guid: 0000000000000000e000000000000000, type: 0}
m_Name: PanelSettings
m_EditorClassIdentifier:
themeUss: {fileID: -4733365628477956816, guid: a1f3f61784a9b574bb5b683d542e7d39, type: 3}
themeUss: {fileID: -4733365628477956816, guid: 59bfacbee7a859f42904b05799bf9437, type: 3}
m_TargetTexture: {fileID: 0}
m_ScaleMode: 2
m_ReferenceSpritePixelsPerUnit: 100
@@ -1,4 +1,4 @@
@import url("/Packages/com.muhua.uicontrol/Assets/Themes/DefaultRuntimeTheme.tss");
@import url("/Assets/FontLibrary/UIToolkit/Fonts.uss");