修复BUG

This commit is contained in:
MuHua-123
2025-10-11 17:27:10 +08:00
parent 21b7cbcef5
commit 4597149228
71 changed files with 285 additions and 1227 deletions
@@ -9,8 +9,6 @@ using MuHua;
/// </summary>
public class InputMenu : InputControl {
private UIMenuPanel menu;
protected override void ModuleInput_OnInputMode(InputMode mode) {
// throw new System.NotImplementedException();
}
@@ -19,11 +17,11 @@ public class InputMenu : InputControl {
/// <summary> 鼠标左键 </summary>
public void OnMouseLeft(InputValue inputValue) {
if (inputValue.isPressed) return;
UIPopupManager.I.shortcutMenu.Close();
ShortcutMenu.I.Close();
}
/// <summary> 鼠标右键 </summary>
public void OnMouseRight(InputValue inputValue) {
UIPopupManager.I.shortcutMenu.Open();
ShortcutMenu.I.Open();
}
#endregion
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 06f31db1c09e8a0409a8b3b960a13216
guid: d73f0702f68e73243ab4c6940caafa59
folderAsset: yes
DefaultImporter:
externalObjects: {}
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 1a20e449063139b4ea0d19bd0677c7d1
guid: 6477bb920cf3e3a4fbaf3e01082e3ae3
folderAsset: yes
DefaultImporter:
externalObjects: {}
@@ -0,0 +1,50 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MuHua;
/// <summary>
/// 快捷菜单
/// </summary>
public class ShortcutMenu : Module<ShortcutMenu> {
/// <summary> 数据列表 </summary>
public List<ShortcutMenuItem> menuItems = new List<ShortcutMenuItem>();
/// <summary> 打开菜单 </summary>
public void Open() => UIShortcutMenu.I?.Open();
/// <summary> 关闭菜单 </summary>
public void Close() => UIShortcutMenu.I?.Close();
/// <summary> 添加菜单项(1级菜单/2级菜单/3级菜单) </summary>
public void Add(string name, Action callback) {
string[] names = name.Split('/');
ShortcutMenuItem item = Find(names[0], menuItems, true);
for (int i = 1; i < names.Length; i++) {
item = Find(names[i], item.menuItems, true);
}
item.callback = callback;
}
/// <summary> 移除菜单项(???/???/子级菜单) </summary>
public void Remove(string name) {
string[] names = name.Split('/');
List<ShortcutMenuItem> menuItems = this.menuItems;
ShortcutMenuItem item = Find(names[0], menuItems, false);
for (int i = 1; i < names.Length; i++) {
if (item == null) return;
menuItems = item.menuItems;
item = Find(names[i], menuItems, false);
}
menuItems.Remove(item);
}
/// <summary> 子项目查找 </summary>
private ShortcutMenuItem Find(string menu, List<ShortcutMenuItem> menuItems, bool isCreate) {
ShortcutMenuItem item = menuItems.Find(obj => obj.name == menu);
if (item != null || !isCreate) { return item; }
item = new ShortcutMenuItem { name = menu };
menuItems.Add(item);
return item;
}
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 00c04ca4ef821d0469a77408648f5ff2
guid: 23732e20aab811a4eba63cc0f810d659
MonoImporter:
externalObjects: {}
serializedVersion: 2
@@ -0,0 +1,16 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// 菜单项目
/// </summary>
public class ShortcutMenuItem {
/// <summary> 名称 </summary>
public string name;
/// <summary> 回调 </summary>
public Action callback;
/// <summary> 子菜单项 </summary>
public List<ShortcutMenuItem> menuItems = new List<ShortcutMenuItem>();
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: c0898288ac15d9a4e9a82e0d6d36ff17
guid: fac2916b09800194a8389027d4b54ce8
MonoImporter:
externalObjects: {}
serializedVersion: 2
@@ -0,0 +1,75 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
using MuHua;
/// <summary>
/// UI快捷菜单面板
/// </summary>
public class UIMenuPanel : ModuleUIPanel, UIControl {
public UIMenuPanel menuPanel;
public VisualElement submenu;
public ModuleUIItems<UIItem, ShortcutMenuItem> items;
public VisualElement Container => Q<VisualElement>("Container");
public UIMenuPanel(VisualElement element, VisualTreeAsset templateAsset) : base(element) {
items = new ModuleUIItems<UIItem, ShortcutMenuItem>(Container, templateAsset,
(data, element) => new UIItem(data, element, this));
}
public void Update() {
// throw new NotImplementedException();
}
public void Dispose() {
items.Release();
}
public void Settings(Vector3 position, List<ShortcutMenuItem> datas) {
items.Create(datas);
element.transform.position = position;
}
/// <summary> 打开子菜单 </summary>
public void Open(VisualElement submenu, List<ShortcutMenuItem> datas) {
if (this.submenu == submenu) { return; }
// 更新子菜单
this.submenu = submenu;
if (menuPanel == null) { menuPanel = UIShortcutMenu.I.Create(); }
float x = submenu.worldBound.position.x + submenu.resolvedStyle.width;
float y = submenu.worldBound.position.y - 4;
Vector3 position = new Vector3(x, y, 0);
menuPanel.Settings(position, datas);
bool isEnable = datas != null && datas.Count > 0;
menuPanel.OpenSubmenu(isEnable);
}
public void OpenSubmenu(bool open) {
element.EnableInClassList("menu-hide", !open);
menuPanel?.OpenSubmenu(false);
}
/// <summary> UI项目 </summary>
public class UIItem : ModuleUIItem<ShortcutMenuItem> {
public readonly UIMenuPanel parent;
public Label Name => element.Q<Label>("Name");
public VisualElement Arrow => element.Q<VisualElement>("Arrow");
public UIItem(ShortcutMenuItem value, VisualElement element, UIMenuPanel parent) : base(value, element) {
this.parent = parent;
Name.text = value.name;
Arrow.EnableInClassList("menu-arrow-hide", value.menuItems == null || value.menuItems.Count == 0);
element.RegisterCallback<MouseDownEvent>(MouseDownEvent);
element.RegisterCallback<MouseMoveEvent>(MouseMoveEvent);
}
private void MouseDownEvent(MouseDownEvent evt) {
value.callback?.Invoke();
UIShortcutMenu.I.Close();
}
private void MouseMoveEvent(MouseMoveEvent evt) {
parent.Open(element, value.menuItems);
}
}
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: d5f8ad3cc3aff1940bdf68f3d911a263
guid: cbfff4523d382a14eb835f39d022b39d
MonoImporter:
externalObjects: {}
serializedVersion: 2
@@ -0,0 +1,51 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
using MuHua;
/// <summary>
/// UI快捷菜单
/// </summary>
public class UIShortcutMenu : ModuleUISingle<UIShortcutMenu> {
/// <summary> 菜单模板 </summary>
public VisualTreeAsset MenuPanel;
/// <summary> 项目模板 </summary>
public VisualTreeAsset MenuTemplate;
/// <summary> 控件列表 </summary>
public static List<UIControl> controls = new List<UIControl>();
public override VisualElement Element => root.Q<VisualElement>("ShortcutMenu");
protected override void Awake() => NoReplace(false);
private void Update() => controls.ForEach(control => control.Update());
private void OnDestroy() => controls.ForEach(control => control.Dispose());
/// <summary> 打开菜单 </summary>
public void Open() {
Close();
Vector3 position = UITool.GetMousePosition(Element);
UIMenuPanel menuPanel = Create();
menuPanel.Settings(position, ShortcutMenu.I.menuItems);
}
/// <summary> 关闭菜单 </summary>
public void Close() {
controls.ForEach(control => control.Dispose());
controls.Clear();
Element.Clear();
}
/// <summary> 创建子菜单 </summary>
public UIMenuPanel Create() {
// 创建菜单元素
VisualElement element = MenuPanel.Instantiate();
element.EnableInClassList("menu", true);
Element.Add(element);
UIMenuPanel menuPanel = new UIMenuPanel(element, MenuTemplate);
controls.Add(menuPanel);
return menuPanel;
}
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 5003b2a36519747449a4b6e4d7e5f56e
guid: 32fa60a7591d8e149b02b5fac56adfb4
folderAsset: yes
DefaultImporter:
externalObjects: {}
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 59a1ea9b07342d04f9b0d4fc62fd24fc
guid: f405743ede2617b4c92bf64862e7402e
folderAsset: yes
DefaultImporter:
externalObjects: {}
@@ -1,14 +1,9 @@
.menu {
position: absolute;
}
.menu-hide {
display: none;
}
.menu-unit {
flex-direction: row;
align-self: flex-start;
flex-grow: 0;
width: 100%;
height: 25px;
}
.menu-unit:hover {
@@ -21,10 +16,10 @@
.menu-arrow {
flex-grow: 0;
height: 30px;
width: 30px;
background-image: url("project://database/Assets/UI%20Toolkit/UnityThemes/UnityDefaultRuntimeTheme.tss?fileID=-1087164816274819069&guid=05f864e67ee1ecb4bbe67427564d394c&type=3#arrow-right@2x");
-unity-background-image-tint-color: rgb(51, 51, 51);
height: 25px;
width: 25px;
background-image: url("project://database/Assets/UI%20Toolkit/UnityThemes/UnityDefaultRuntimeTheme.tss?fileID=-1087164816274819069&guid=59bfacbee7a859f42904b05799bf9437&type=3#arrow-right@2x");
-unity-background-image-tint-color: rgb(51, 50, 50);
}
.menu-arrow-hide {
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 75986de11cb02ce479624ef7b29e3193
guid: 4b1be5340ef21d843bdd2f0eb2375cfe
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
@@ -0,0 +1,11 @@
<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:Template name="Item" src="project://database/Assets/ModuleCore/ModuleUISMenu/UI%20Toolkit/MenuPanel/MenuTemplate.uxml?fileID=9197481963319205126&amp;guid=1ee167986f6e9a840a45450b4b6adfc2&amp;type=3#MenuTemplate" />
<Style src="project://database/Assets/ModuleCore/ModuleUISMenu/UI%20Toolkit/MenuPanel/MenuPanel.uss?fileID=7433441132597879392&amp;guid=4b1be5340ef21d843bdd2f0eb2375cfe&amp;type=3#MenuPanel" />
<ui:VisualElement name="Container" style="background-color: rgb(255, 255, 255); border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; align-self: flex-start; min-width: 150px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-left-color: rgb(51, 51, 51); border-right-color: rgb(51, 51, 51); border-top-color: rgb(51, 51, 51); border-bottom-color: rgb(51, 51, 51);">
<ui:Instance template="Item" name="Item" />
<ui:Instance template="Item" name="Item" />
<ui:Instance template="Item" name="Item" />
<ui:Instance template="Item" name="Item" />
<ui:Instance template="Item" name="Item" />
</ui:VisualElement>
</ui:UXML>
@@ -1,7 +1,9 @@
<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/UI%20Toolkit/GamePopup/ShortcutMenu/ShortcutMenu.uss?fileID=7433441132597879392&amp;guid=a53da9fc389948e40ac96af14dd02c10&amp;type=3#ShortcutMenu" />
<Style src="project://database/Assets/ModuleCore/ModuleUISMenu/UI%20Toolkit/MenuPanel/MenuPanel.uss?fileID=7433441132597879392&amp;guid=4b1be5340ef21d843bdd2f0eb2375cfe&amp;type=3#MenuPanel" />
<ui:VisualElement class="menu-unit">
<ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="Name" style="-unity-text-align: middle-center; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; height: 30px;" />
<ui:VisualElement style="width: 30px;" />
<ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="Name" style="-unity-text-align: middle-center; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px;" />
<ui:VisualElement style="flex-grow: 1;" />
<ui:VisualElement name="Arrow" class="menu-arrow" />
</ui:VisualElement>
</ui:UXML>
@@ -0,0 +1,7 @@
.menu {
position: absolute;
}
.menu-hide {
display: none;
}
+3 -4
View File
@@ -25,10 +25,9 @@ public class SingleManager : ModuleSingle<SingleManager> {
equipmentReward = new ItemReward();
equipmentReward.Settings(ManagerItem.I.equipments);
UIShortcutMenu shortcutMenu = UIPopupManager.I.shortcutMenu;
shortcutMenu.Add("背包", () => { ModuleUI.Settings(Page.Backpack); });
shortcutMenu.Add("奖励/材料", RewardMaterial);
shortcutMenu.Add("奖励/装备", RewardEquipment);
ShortcutMenu.I.Add("背包", () => { ModuleUI.Settings(Page.Backpack); });
ShortcutMenu.I.Add("奖励/材料", RewardMaterial);
ShortcutMenu.I.Add("奖励/装备", RewardEquipment);
ValueSystem.I.Initial();
}
@@ -1,48 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
using MuHua;
/// <summary>
/// SliderInputH - Panel
/// </summary>
public class UISliderInputH : ModuleUIPanel {
public float value;
public Vector2 range = new Vector2(1, 1);
public UISliderH slider;
public event Action<float> ValueChanged;
public VisualElement Slider => Q<VisualElement>("Slider");
public UIFloatField FloatField => Q<UIFloatField>("UIFloatField");
public UISliderInputH(VisualElement element, VisualElement canvas) : base(element) {
slider = new UISliderH(element, canvas);
slider.ValueChanged += Slider_ValueChanged;
FloatField.RegisterCallback<ChangeEvent<float>>(FloatField_ValueChanged);
}
private void Slider_ValueChanged(float obj) {
value = Mathf.Lerp(range.x, range.y, obj);
FloatField.SetValueWithoutNotify(value);
ValueChanged?.Invoke(value);
}
private void FloatField_ValueChanged(ChangeEvent<float> obj) {
value = Mathf.Clamp(obj.newValue, range.x, range.y);
float scale = Mathf.InverseLerp(range.x, range.y, value);
slider.UpdateValue(scale, false);
ValueChanged?.Invoke(value);
}
public void Update() {
slider.Update();
}
/// <summary> 更新值 </summary>
public void UpdateValue(float value) {
this.value = Mathf.Clamp(range.x, range.y, value);
float scale = Mathf.InverseLerp(range.x, range.y, value);
slider.UpdateValue(scale, false);
FloatField.SetValueWithoutNotify(value);
}
}
@@ -1,64 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
using MuHua;
/// <summary>
/// Vector2 - Panel
/// </summary>
public class UIVector2 : ModuleUIPanel {
public bool isLock;
public Vector2 value;
public UISliderInputH sliderX;
public UISliderInputH sliderY;
public event Action<Vector2, bool> ValueChanged;
public Button Lock => Q<Button>("Lock");
public VisualElement SliderX => Q<VisualElement>("SliderInputX");
public VisualElement SliderY => Q<VisualElement>("SliderInputY");
public UIVector2(VisualElement element, VisualElement canvas) : base(element) {
sliderX = new UISliderInputH(SliderX, canvas);
sliderY = new UISliderInputH(SliderY, canvas);
Lock.clicked += Lock_clicked;
sliderX.ValueChanged += SliderX_ValueChanged;
sliderY.ValueChanged += SliderY_ValueChanged;
}
private void Lock_clicked() {
isLock = !isLock;
Lock.EnableInClassList("dashboard-button-s", isLock);
if (isLock) { value.y = value.x; sliderY.UpdateValue(value.x); }
ValueChanged?.Invoke(value, isLock);
}
private void SliderX_ValueChanged(float obj) {
value.x = obj;
if (isLock) { value.y = obj; sliderY.UpdateValue(obj); }
ValueChanged?.Invoke(value, isLock);
}
private void SliderY_ValueChanged(float obj) {
value.y = obj;
if (isLock) { value.x = obj; sliderX.UpdateValue(obj); }
ValueChanged?.Invoke(value, isLock);
}
public void Update() {
sliderX.Update();
sliderY.Update();
}
/// <summary> 更新值 </summary>
public void UpdateValue(Vector2 value, bool isLock) {
this.value = value;
this.isLock = isLock;
sliderX.UpdateValue(value.x);
sliderY.UpdateValue(value.y);
Lock.EnableInClassList("dashboard-button-s", isLock);
}
/// <summary> 设置范围 </summary>
public void Settings(Vector2 range) {
sliderX.range = range;
sliderY.range = range;
}
}
@@ -1,63 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
using MuHua;
/// <summary>
/// Vector3 - Panel
/// </summary>
public class UIVector3 : ModuleUIPanel {
public Vector3 value;
public UISliderInputH sliderX;
public UISliderInputH sliderY;
public UISliderInputH sliderZ;
public event Action<Vector3> ValueChanged;
public VisualElement SliderInputX => Q<VisualElement>("SliderInputX");
public VisualElement SliderInputY => Q<VisualElement>("SliderInputY");
public VisualElement SliderInputZ => Q<VisualElement>("SliderInputZ");
public UIVector3(VisualElement element, VisualElement canvas) : base(element) {
sliderX = new UISliderInputH(SliderInputX, canvas);
sliderY = new UISliderInputH(SliderInputY, canvas);
sliderZ = new UISliderInputH(SliderInputZ, canvas);
sliderX.ValueChanged += SliderX_ValueChanged;
sliderY.ValueChanged += SliderY_ValueChanged;
sliderZ.ValueChanged += SliderZ_ValueChanged;
}
private void SliderX_ValueChanged(float obj) {
value.x = obj;
ValueChanged?.Invoke(value);
}
private void SliderY_ValueChanged(float obj) {
value.y = obj;
ValueChanged?.Invoke(value);
}
private void SliderZ_ValueChanged(float obj) {
value.z = obj;
ValueChanged?.Invoke(value);
}
public void Update() {
sliderX.Update();
sliderY.Update();
sliderZ.Update();
}
/// <summary> 更新值 </summary>
public void UpdateValue(Vector3 value) {
this.value = value;
sliderX.UpdateValue(value.x);
sliderY.UpdateValue(value.y);
sliderZ.UpdateValue(value.z);
}
/// <summary> 设置范围 </summary>
public void Settings(Vector2 range) {
sliderX.range = range;
sliderY.range = range;
sliderZ.range = range;
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 36d613e41a27e8f40be6e6c05de1aeb1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,113 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
using UnityEngine.Video;
using MuHua;
/// <summary>
/// 视频播放控件
/// </summary>
public class UIVideoPlayPanel : ModuleUIPanel {
private float showTime;
private bool isDownSlider;
private Action fullAction;
private RenderTexture renderTexture;
private VideoPlayer videoPlayer;
private UISliderH slider;
private VisualElement VideoView => element.Q<VisualElement>("VideoView");
private VisualElement VideoController => element.Q<VisualElement>("VideoController");
private VisualElement Slider => element.Q<VisualElement>("Slider");
private Label Time => element.Q<Label>("Time");
private Button Play => element.Q<Button>("Play");
private Button Pause => element.Q<Button>("Pause");
private Button FullScreen => element.Q<Button>("FullScreen");
public UIVideoPlayPanel(VisualElement element, VisualElement canvas, VideoPlayer videoPlayer, Action fullAction = null) : base(element) {
this.videoPlayer = videoPlayer;
this.fullAction = fullAction;
int width = (int)element.parent.resolvedStyle.width;
int height = (int)element.parent.resolvedStyle.height;
renderTexture = new RenderTexture(width, height, 0);
Background background = Background.FromRenderTexture(renderTexture);
VideoView.style.backgroundImage = new StyleBackground(background);
Play.clicked += Play_clicked;
Pause.clicked += Pause_clicked;
FullScreen.clicked += FullScreen_clicked;
VideoView.RegisterCallback<PointerDownEvent>((evt) => showTime = 5);
VideoController.RegisterCallback<PointerDownEvent>((evt) => showTime = 5);
Slider.RegisterCallback<PointerDownEvent>((evt) => isDownSlider = true);
Slider.RegisterCallback<PointerUpEvent>((evt) => isDownSlider = false);
Slider.RegisterCallback<PointerLeaveEvent>((evt) => isDownSlider = false);
slider = new UISliderH(element, canvas);
slider.ValueChanged += Slider_SlidingValueChanged;
}
/// <summary> 启用 </summary>
public void Enable(string url) {
videoPlayer.url = url; Enable();
}
/// <summary> 启用 </summary>
public void Enable() {
UpdateRenderTexture();
videoPlayer.targetTexture = renderTexture;
if (videoPlayer.isPlaying) { Play_clicked(); }
else { Pause_clicked(); }
}
/// <summary> 更新 </summary>
public void Update() {
if (videoPlayer == null) { return; }
showTime -= UnityEngine.Time.deltaTime;
Visibility visibility = showTime > 0 ? Visibility.Visible : Visibility.Hidden;
VideoController.style.visibility = visibility;
//进度条
float value = (float)videoPlayer.frame / (float)videoPlayer.frameCount;
if (!isDownSlider) { slider.UpdateValue(value, false); }
//播放时间
string clockTime = TimeSpan.FromSeconds(videoPlayer.clockTime).ToString(@"mm\:ss");
string length = TimeSpan.FromSeconds(videoPlayer.length).ToString(@"mm\:ss");
Time.text = clockTime + "/" + length;
}
/// <summary> 播放 </summary>
public void Play_clicked() {
if (videoPlayer == null) { return; }
videoPlayer.Play(); showTime = 5;
Play.style.display = DisplayStyle.None;
Pause.style.display = DisplayStyle.Flex;
}
/// <summary> 暂停 </summary>
public void Pause_clicked() {
if (videoPlayer == null) { return; }
videoPlayer.Pause();
Play.style.display = DisplayStyle.Flex;
Pause.style.display = DisplayStyle.None;
}
/// <summary> 更新渲染纹理 </summary>
private void UpdateRenderTexture() {
int width = (int)element.parent.resolvedStyle.width;
int height = (int)element.parent.resolvedStyle.height;
if (renderTexture.width == width && renderTexture.height == height) { return; }
renderTexture.Release();
renderTexture = new RenderTexture(width, height, 0);
Background background = Background.FromRenderTexture(renderTexture);
VideoView.style.backgroundImage = new StyleBackground(background);
}
/// <summary> 全屏 </summary>
private void FullScreen_clicked() {
fullAction?.Invoke();
}
/// <summary> 进度条更新 </summary>
private void Slider_SlidingValueChanged(float obj) {
if (videoPlayer == null) { return; }
videoPlayer.frame = (long)obj;
}
}
@@ -1,25 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
using MuHua;
/// <summary>
/// 消息页面1
/// </summary>
public class UIMessage1 : ModuleUIPanel {
public Label Content => Q<Label>("Content");
public UIMessage1(VisualElement element) : base(element) { }
/// <summary>
/// 设置消息内容
/// </summary>
/// <param name="active"></param>
/// <param name="value"></param>
public void Settings(bool active, string value = "") {
element.EnableInClassList("document-page-hide", !active);
Content.text = value;
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: c0d9cdd61f07fb14a93de29e68c71787
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,31 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
using MuHua;
/// <summary>
/// 消息页面2
/// </summary>
public class UIMessage2 : ModuleUIPanel {
private Action callback;
public Label Content => Q<Label>("Content");
public Button Button => Q<Button>("Button");
public UIMessage2(VisualElement element) : base(element) {
Button.clicked += () => { callback?.Invoke(); Settings(false); };
}
public void Settings(bool active) {
element.EnableInClassList("document-page-hide", !active);
callback = null;
}
public void Settings(bool active, string value = "", Action callback = null) {
element.EnableInClassList("document-page-hide", !active);
Content.text = value;
this.callback = callback;
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: d21953f5fb6c41e40b2df711d80a42b3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,31 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
using MuHua;
/// <summary>
/// 消息页面3
/// </summary>
public class UIMessage3 : ModuleUIPanel {
private Action callback1;
private Action callback2;
public Label Content => Q<Label>("Content");
public Button Button1 => Q<Button>("Button1");
public Button Button2 => Q<Button>("Button2");
public UIMessage3(VisualElement element) : base(element) {
Button1.clicked += () => { callback1?.Invoke(); Settings(false); };
Button2.clicked += () => { callback2?.Invoke(); Settings(false); };
}
public void Settings(bool active, string value = "", Action callback1 = null, Action callback2 = null) {
element.EnableInClassList("document-page-hide", !active);
Content.text = value;
this.callback1 = callback1;
this.callback2 = callback2;
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 496a1fe1e90187b45b931ec732c0bde6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,18 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class UIBannerTip : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 7279e9c7234eb6645b7b1e172b70919d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,132 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
using MuHua;
/// <summary>
/// 指针提示
/// </summary>
public class UIGuidance : ModuleUIPanel {
private bool isDown;
private Action callback;
private Action<bool> ValueChanged;
private Vector2 offset;
private Vector3 originalPosition;
private Vector3 pointerPosition;
private VisualElement target;
private UIToggle toggle;
public Label Prompt => Q<Label>("Prompt");
public VisualElement Toggle => Q<VisualElement>("Toggle");
public VisualElement Button => Q<VisualElement>("Button");
public VisualElement Pointer => Q<VisualElement>("Pointer");
public UIGuidance(VisualElement element) : base(element) {
toggle = new UIToggle(Toggle);
toggle.ValueChanged += (value) => { ValueChanged?.Invoke(value); };
Button.RegisterCallback<ClickEvent>(ClickEvent);
element.RegisterCallback<MouseDownEvent>(MouseDownEvent);
element.RegisterCallback<MouseUpEvent>(MouseUpEvent);
}
public void Update() {
#if UNITY_EDITOR
if (target == null) { return; }
if (isDown) {
Vector3 mousePosition = UITool.GetMousePosition();
Vector3 differ = new Vector3(mousePosition.x, Screen.height - mousePosition.y) - pointerPosition;
Pointer.transform.position = originalPosition + differ;
}
else {
Pointer.transform.position = target.worldBound.position + offset;
}
#else
if (target == null) { return; }
Pointer.transform.position = target.worldBound.position + offset;
#endif
}
private void ClickEvent(ClickEvent evt) {
element.EnableInClassList("document-page-hide", true);
callback?.Invoke();
}
private void MouseDownEvent(MouseDownEvent evt) {
#if UNITY_EDITOR
isDown = true;
originalPosition = Pointer.transform.position;
Vector3 mousePosition = UITool.GetMousePosition();
pointerPosition = new Vector3(mousePosition.x, Screen.height - mousePosition.y);
#endif
}
private void MouseUpEvent(MouseUpEvent evt) {
isDown = false;
float x = Pointer.transform.position.x - target.worldBound.position.x;
float y = Pointer.transform.position.y - target.worldBound.position.y;
Vector3 offset = new Vector3(x, y);
Debug.Log(offset);
}
/// <summary> 打开提示 </summary>
public void Settings(string content, VisualElement target, Vector2 offset, Action callback) {
this.target = target;
this.offset = offset;
this.callback = callback;
Prompt.text = content;
element.EnableInClassList("document-page-hide", false);
}
/// <summary> 设置提示 </summary>
public void Settings(bool value, Action<bool> ValueChanged) {
this.ValueChanged = ValueChanged;
toggle.UpdateValue(value, false);
}
}
/// <summary>
/// 图案页指引
/// </summary>
public class UIPatternPageGuidance : ModuleUIPanel {
private bool isNot;
public VisualElement Top => Q<VisualElement>("Top");
public Button Button1 => Top.Q<Button>("Button1");// 创建图案
public Button Button4 => Top.Q<Button>("Button4");// 创建元素
public VisualElement Dashboard => Q<VisualElement>("Dashboard");
public VisualElement PatternLibrary => Q<VisualElement>("PatternLibrary");
public VisualElement TemplateLibrary => Q<VisualElement>("TemplateLibrary");
public UIPatternPageGuidance(VisualElement element) : base(element) { }
public void Guidance1() {
if (isNot) { return; }
string content = "第一步 点击【创建图案】按钮,即可新建一个空白画板,开始您的设计。";
Guidance(content, Button1, new Vector2(140, -55), Guidance2);
}
public void Guidance2() {
string content = "第二步 提供两种创作方式 \n1,选用模板:点击【图案模板】,选择模板后参考其结构与配色,进行纹样重构与创新设计。";
Guidance(content, TemplateLibrary, new Vector2(310, 0), Guidance3);
}
public void Guidance3() {
string content = "2,全新创作:点击【创建元素】创建空白图案框,自行选择【图案元素库】内的图案素材进行创新设计。";
Guidance(content, Button4, new Vector2(-530, -65), Guidance4);
}
public void Guidance4() {
string content = "导入个人素材:点击【自定义】-【导入素材】,导入后请点击【自定义】刷新以更新显示。";
Guidance(content, PatternLibrary, new Vector2(310, 0), Guidance5);
}
public void Guidance5() {
string content = "图案编辑功能:选中图案元素,可调整其颜色、位置、大小、镜像、连续排列等操作。\n画布设置:如设计透明背景的图案,可根据图案色彩风格自定义画板颜色,便于更直观地进行设计。";
Guidance(content, Dashboard, new Vector2(-530, 0), null);
}
public void Guidance(string content, VisualElement visual, Vector3 offset, Action action) {
// UIGuidance guidance = ModuleUI.I.popupManager.guidance;
// guidance.Settings(content, visual, offset, action);
// guidance.Settings(isNot, (value) => { isNot = value; });
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 8df138b434ab51f40b134f831376120e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,31 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
using MuHua;
/// <summary>
/// 加载页面
/// </summary>
public class UILoading : ModuleUIPanel {
public UISliderH slider;
public VisualElement Slider => Q<VisualElement>("Slider");
public UILoading(VisualElement element, VisualElement canvas) : base(element) {
slider = new UISliderH(Slider, canvas);
}
/// <summary>
/// 设置加载进度
/// </summary>
/// <param name="active"></param>
/// <param name="value1"></param>
/// <param name="value2"></param>
public void Settings(bool active, float value1, string value2) {
element.EnableInClassList("document-page-hide", !active);
slider.UpdateValue(value1);
slider.Title.text = value2;
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 637e7bc032a4bee4aa936fb481495299
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,170 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
using MuHua;
/// <summary>
/// UI快捷菜单
/// </summary>
public class UIShortcutMenu : ModuleUIPanel, UIControl {
/// <summary> 菜单模板 </summary>
public VisualTreeAsset menuTreeAsset;
/// <summary> 项目模板 </summary>
public VisualTreeAsset itemTreeAsset;
/// <summary> 数据列表 </summary>
public List<DataMenuItem> datas = new List<DataMenuItem>();
/// <summary> 控件列表 </summary>
public static List<UIControl> controls = new List<UIControl>();
public UIShortcutMenu(VisualElement element, VisualTreeAsset menuTreeAsset, VisualTreeAsset itemTreeAsset) : base(element) {
this.menuTreeAsset = menuTreeAsset;
this.itemTreeAsset = itemTreeAsset;
ModuleUI.AddControl(this);
}
public void Update() => controls.ForEach(control => control.Update());
public void Dispose() => controls.ForEach(control => control.Dispose());
/// <summary> 打开菜单 </summary>
public void Open() {
Close();
Vector3 position = UITool.GetMousePosition(element);
UIMenuPanel menuPanel = Create();
menuPanel.Settings(position, datas);
}
/// <summary> 关闭菜单 </summary>
public void Close() {
controls.ForEach(control => control.Dispose());
controls.Clear();
element.Clear();
}
/// <summary> 创建子菜单 </summary>
public UIMenuPanel Create() {
// 创建菜单元素
VisualElement menu = menuTreeAsset.Instantiate();
menu.EnableInClassList("menu", true);
element.Add(menu);
UIMenuPanel menuPanel = new UIMenuPanel(menu, itemTreeAsset, this);
controls.Add(menuPanel);
return menuPanel;
}
/// <summary> 添加菜单项(方法) </summary>
public void Add(string name, Action callback) {
string[] names = name.Split('/');
List<DataMenuItem> datas = this.datas;
for (int i = 0; i < names.Length; i++) {
DataMenuItem item = Find(names[i], datas);
datas = item.items;
if (i == names.Length - 1) { item.callback = callback; }
}
}
/// <summary> 移除菜单项 </summary>
public void Remove(string name) {
string[] names = name.Split('/');
List<DataMenuItem> datas = this.datas;
for (int i = 0; i < names.Length; i++) {
DataMenuItem item = Find(names[i], datas, false);
// 未找到,直接返回
if (item == null) { return; }
// 找到要移除的项
if (i == names.Length - 1) { datas.Remove(item); }
datas = item.items;
}
}
/// <summary> 查询菜单项 </summary>
public DataMenuItem Find(string name, List<DataMenuItem> datas, bool isCreate = true) {
DataMenuItem item = datas.Find(obj => obj.name == name);
if (item != null || !isCreate) { return item; }
item = new DataMenuItem { name = name };
datas.Add(item);
return item;
}
}
/// <summary>
/// UI快捷菜单面板
/// </summary>
public class UIMenuPanel : ModuleUIPanel, UIControl {
public readonly UIShortcutMenu parent;
public UIMenuPanel menuPanel;
public VisualElement submenu;
public ModuleUIItems<UIItem, DataMenuItem> items;
public VisualElement Container => Q<VisualElement>("Container");
public UIMenuPanel(VisualElement element, VisualTreeAsset templateAsset, UIShortcutMenu parent) : base(element) {
this.parent = parent;
items = new ModuleUIItems<UIItem, DataMenuItem>(Container, templateAsset,
(data, element) => new UIItem(data, element, this, parent));
}
public void Update() { }
public void Dispose() => items.Release();
public void Settings(Vector3 position, List<DataMenuItem> datas) {
items.Create(datas);
element.transform.position = position;
}
/// <summary> 打开子菜单 </summary>
public void Open(VisualElement submenu, List<DataMenuItem> datas) {
if (this.submenu == submenu) { return; }
// 更新子菜单
this.submenu = submenu;
if (menuPanel == null) { menuPanel = parent.Create(); }
float x = submenu.worldBound.position.x + submenu.resolvedStyle.width;
float y = submenu.worldBound.position.y - 5;
Vector3 position = new Vector3(x, y, 0);
menuPanel.Settings(position, datas);
bool isEnable = datas != null && datas.Count > 0;
menuPanel.OpenSubmenu(isEnable);
}
public void OpenSubmenu(bool open) {
element.EnableInClassList("menu-hide", !open);
menuPanel?.OpenSubmenu(false);
}
/// <summary> UI项目 </summary>
public class UIItem : ModuleUIItem<DataMenuItem> {
public readonly UIMenuPanel parent;
public readonly UIShortcutMenu shortcutMenu;
public Label Name => element.Q<Label>("Name");
public VisualElement Arrow => element.Q<VisualElement>("Arrow");
public UIItem(DataMenuItem value, VisualElement element, UIMenuPanel parent, UIShortcutMenu shortcutMenu) : base(value, element) {
this.parent = parent;
this.shortcutMenu = shortcutMenu;
Name.text = value.name;
Arrow.EnableInClassList("menu-arrow-hide", value.items == null || value.items.Count == 0);
element.RegisterCallback<MouseDownEvent>(MouseDownEvent);
element.RegisterCallback<MouseMoveEvent>(MouseMoveEvent);
}
private void MouseDownEvent(MouseDownEvent evt) {
value.callback?.Invoke();
shortcutMenu.Close();
}
private void MouseMoveEvent(MouseMoveEvent evt) {
parent.Open(element, value.items);
}
}
}
/// <summary>
/// 菜单项目
/// </summary>
public class DataMenuItem {
/// <summary> 名称 </summary>
public string name;
/// <summary> 回调 </summary>
public Action callback;
/// <summary> 子菜单项 </summary>
public List<DataMenuItem> items = new List<DataMenuItem>();
}
@@ -1,31 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
using MuHua;
/// <summary>
/// UI加载管理器
/// </summary>
public class UILoadManager : ModuleUIPage {
// public UIProgres progres;
public override VisualElement Element => root.Q<VisualElement>("Popup");
public VisualElement PopupDialog => Q<VisualElement>("PopupDialog");
private void Awake() {
// progres = new UIProgres(PopupDialog);
}
private void OnDestroy() {
// config.Release();
// configMaterial.Release();
// equipmentSelection.Release();
// paramrInput.Release();
}
private void Update() {
// config.Update();
// configMaterial.Update();
}
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 2da9aad7a772f434080f14bd479de19c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -14,16 +14,13 @@ public class UIPopupManager : ModuleUISingle<UIPopupManager> {
public VisualTreeAsset itemTreeAsset;
public UIInventoryDrag inventoryDrag;
public UIShortcutMenu shortcutMenu;
public override VisualElement Element => root.Q<VisualElement>("Popup");
public VisualElement DragItem => Q<VisualElement>("DragItem");
public VisualElement ShortcutMenu => Q<VisualElement>("ShortcutMenu");
protected override void Awake() {
NoReplace(false);
inventoryDrag = new UIInventoryDrag(DragItem, root);
shortcutMenu = new UIShortcutMenu(ShortcutMenu, menuTreeAsset, itemTreeAsset);
}
}
@@ -199,6 +199,53 @@ Transform:
- {fileID: 963194228}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &567377853
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 567377854}
- component: {fileID: 567377855}
m_Layer: 5
m_Name: UIShortcutMenu
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &567377854
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 567377853}
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: 670296964}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &567377855
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 567377853}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 422a458e7229d6b4a8fff66af1840238, type: 3}
m_Name:
m_EditorClassIdentifier:
document: {fileID: 670296963}
MenuPanel: {fileID: 9197481963319205126, guid: 5034a86c1b336b644968fdb3be5f851a, type: 3}
MenuTemplate: {fileID: 9197481963319205126, guid: 1ee167986f6e9a840a45450b4b6adfc2, type: 3}
--- !u!1 &670296962
GameObject:
m_ObjectHideFlags: 0
@@ -248,6 +295,7 @@ Transform:
m_Children:
- {fileID: 1330756993}
- {fileID: 1532585504}
- {fileID: 567377854}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &670296965
@@ -257,7 +305,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 670296962}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ea89ac05041b5d74582ee9d0add233ac, type: 3}
m_Name:
@@ -686,15 +734,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 287f1e957d7061a42977427a98b178b5, type: 3}
m_Name:
m_EditorClassIdentifier:
materials:
- {fileID: 11400000, guid: 9bab95ad6d8464f479c14ff315c21003, type: 2}
- {fileID: 11400000, guid: 0e8026d397d773c40be344cda8f74733, type: 2}
- {fileID: 11400000, guid: de15140ad41f7694faa3f93732713d89, type: 2}
- {fileID: 11400000, guid: d871485f33cb47941b1ded80b4b957e4, type: 2}
- {fileID: 11400000, guid: 91644dc2132b79a43a2c2132430d620c, type: 2}
- {fileID: 11400000, guid: 2cae58756c953364cb82ebeab9044f91, type: 2}
- {fileID: 11400000, guid: 3730099e2e68c3542b98c0dfb4021852, type: 2}
- {fileID: 11400000, guid: cc75bbd52a24b2444be229933da52925, type: 2}
equipments:
- {fileID: 11400000, guid: 03acc552c7399334f989ab93c1c4cc29, type: 2}
- {fileID: 11400000, guid: 905c298f3d6d27a40a2ca6a5f6339091, type: 2}
+2 -2
View File
@@ -1,11 +1,11 @@
<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:Template name="BackpackPage" src="project://database/Assets/UI%20Toolkit/GamePage/BackpackPage/BackpackPage.uxml?fileID=9197481963319205126&amp;guid=ee4c8ffa6ea228a4bb9b4bc3d3ad1aa5&amp;type=3#BackpackPage" />
<ui:Template name="ShortcutMenu" src="project://database/Assets/UI%20Toolkit/GamePopup/ShortcutMenu/ShortcutMenu.uxml?fileID=9197481963319205126&amp;guid=531a74f84d51b5d49a048079629e13e0&amp;type=3#ShortcutMenu" />
<ui:Template name="DragItem" src="project://database/Assets/UI%20Toolkit/GamePopup/DragItem/DragItem.uxml?fileID=9197481963319205126&amp;guid=1b65b69e130e82d4988ced4551c8f876&amp;type=3#DragItem" />
<ui:Template name="ShortcutMenu" src="project://database/Assets/ModuleCore/ModuleUISMenu/UI%20Toolkit/ShortcutMenu/ShortcutMenu.uxml?fileID=9197481963319205126&amp;guid=531a74f84d51b5d49a048079629e13e0&amp;type=3#ShortcutMenu" />
<Style src="project://database/Assets/UI%20Toolkit/Document/Document.uss?fileID=7433441132597879392&amp;guid=9205939af30a4394f8f2e34232b27890&amp;type=3#Document" />
<ui:Instance template="BackpackPage" name="BackpackPage" class="document-page document-page-hide" />
<ui:Instance template="ShortcutMenu" name="ShortcutMenu" picking-mode="Ignore" class="document-page" />
<ui:VisualElement name="Popup" picking-mode="Ignore" class="document-page" style="flex-grow: 1;">
<ui:Instance template="DragItem" name="DragItem" picking-mode="Ignore" class="document-page document-page-hide" />
<ui:Instance template="ShortcutMenu" name="ShortcutMenu" picking-mode="Ignore" class="document-page" />
</ui:VisualElement>
</ui:UXML>
@@ -1,29 +0,0 @@
.banner {
height: 300px;
background-color: rgb(40, 137, 255);
transition-duration: 0.2s;
}
.banner-d {
scale: 1 0;
}
.banner-label {
flex-grow: 1;
color: rgb(255, 255, 255);
-unity-text-align: middle-center;
margin-top: 0;
margin-right: 0;
margin-bottom: 0;
margin-left: 0;
padding-top: 0;
padding-right: 0;
padding-bottom: 0;
padding-left: 0;
font-size: 60px;
transition-duration: 0.2s;
}
.banner-label-d {
scale: 0 0;
}
@@ -1,8 +0,0 @@
<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/UI%20Toolkit/GamePopup/BannerTip/BannerTip.uss?fileID=7433441132597879392&amp;guid=75986de11cb02ce479624ef7b29e3193&amp;type=3#BannerTip" />
<ui:VisualElement name="Background" style="flex-grow: 1; align-items: stretch; justify-content: space-around; background-color: rgba(0, 0, 0, 0.3);">
<ui:VisualElement name="Banner" class="banner">
<ui:Label tabindex="-1" text="LabelLabelLabelLabelLabelLabel" parse-escape-sequences="true" display-tooltip-when-elided="true" class="banner-label" />
</ui:VisualElement>
</ui:VisualElement>
</ui:UXML>
@@ -1,10 +0,0 @@
fileFormatVersion: 2
guid: e4a01fc5cb705fe4c9bedf1d0c5df107
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 91776b8426e091246ae2122b48e4b927
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,30 +0,0 @@
.guidance {
border-top-left-radius: 40px;
border-top-right-radius: 40px;
border-bottom-right-radius: 40px;
border-bottom-left-radius: 40px;
margin-top: 0;
margin-right: 0;
margin-bottom: 0;
margin-left: 0;
padding-top: 10px;
padding-right: 10px;
padding-bottom: 10px;
padding-left: 10px;
transform-origin: center;
transition-duration: 0.2s;
position: absolute;
flex-shrink: 0;
flex-grow: 1;
align-items: stretch;
width: 500px;
background-color: rgb(255, 255, 255);
border-left-color: rgb(243, 88, 239);
border-right-color: rgb(243, 88, 239);
border-top-color: rgb(243, 88, 239);
border-bottom-color: rgb(243, 88, 239);
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: fda0d75350465b344915192b3cd6a449
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
disableValidation: 0
@@ -1,20 +0,0 @@
<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/UI%20Toolkit/GamePopup/Guidance/Guidance.uss?fileID=7433441132597879392&amp;guid=fda0d75350465b344915192b3cd6a449&amp;type=3#Guidance" />
<ui:VisualElement name="Pointer" style="position: absolute;">
<ui:VisualElement class="guidance">
<ui:Label tabindex="-1" text="LabelLabelLabelLabelLabelLabLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabelLabel&#10;&#10;elLabelLabelLabelLabelLabelLabel" parse-escape-sequences="true" display-tooltip-when-elided="true" name="Prompt" picking-mode="Ignore" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; font-size: 24px; white-space: normal;" />
<ui:VisualElement style="flex-grow: 1; flex-direction: row; align-items: center; justify-content: space-between; padding-top: 10px; padding-right: 10px; padding-bottom: 0; padding-left: 10px;">
<ui:VisualElement name="Toggle">
<Style src="project://database/Assets/UI%20Toolkit/Component/Toggle/Toggle.uss?fileID=7433441132597879392&amp;guid=9110c01e0b68bd9429ca5de756897be0&amp;type=3#Toggle" />
<ui:VisualElement class="toggle" style="flex-direction: row-reverse;">
<ui:Label tabindex="-1" text="不在提示" parse-escape-sequences="true" display-tooltip-when-elided="true" name="Title" class="toggle-title" style="color: rgb(28, 28, 28); padding-bottom: 5px; padding-top: 3px; padding-right: 3px; padding-left: 3px;" />
<ui:VisualElement name="Input" class="toggle-input">
<ui:VisualElement name="Check" class="toggle-check toggle-check-hide" style="background-image: url(&quot;project://database/Assets/UI%20Toolkit/UnityThemes/UnityDefaultRuntimeTheme.tss?fileID=-6090568113533005507&amp;guid=05f864e67ee1ecb4bbe67427564d394c&amp;type=3#check&quot;); -unity-background-image-tint-color: rgb(51, 51, 51);" />
</ui:VisualElement>
</ui:VisualElement>
</ui:VisualElement>
<ui:Label tabindex="-1" text="&lt;u&gt;下一步" parse-escape-sequences="true" display-tooltip-when-elided="true" name="Button" style="font-size: 24px; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0;" />
</ui:VisualElement>
</ui:VisualElement>
</ui:VisualElement>
</ui:UXML>
@@ -1,10 +0,0 @@
fileFormatVersion: 2
guid: 2317be6da4c8d8541b81d990bc3b6911
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
-8
View File
@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: d909de94d183c3941995a31368040270
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -1 +0,0 @@
VisualElement {}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: b1e4363420ab230499d487ec1ad2ad29
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
disableValidation: 0
@@ -1,13 +0,0 @@
<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 style="flex-grow: 1; flex-direction: column-reverse; padding-top: 50px; padding-right: 50px; padding-bottom: 50px; padding-left: 50px; align-items: center; background-image: none; background-color: rgba(0, 0, 0, 0);">
<ui:VisualElement name="Slider" class="slider-horizontal" style="flex-direction: column; width: 1000px; height: 60px; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0;">
<ui:Label tabindex="-1" text="加载中。。。" parse-escape-sequences="true" display-tooltip-when-elided="true" name="Title" class="slider-horizontal-title" style="height: 30px; -unity-text-align: middle-center;" />
<ui:VisualElement name="Container" class="slider-horizontal-container" style="width: 100%; height: 30px; flex-grow: 0; flex-shrink: 1; border-top-left-radius: 10px; border-top-right-radius: 10px; border-bottom-right-radius: 10px; border-bottom-left-radius: 10px; background-color: rgb(255, 255, 255);">
<ui:VisualElement name="Tracker" class="slider-horizontal-tracker" style="border-top-left-radius: 8px; border-top-right-radius: 8px; border-bottom-right-radius: 8px; border-bottom-left-radius: 8px; border-top-width: 2px; border-right-width: 2px; border-bottom-width: 2px; border-left-width: 2px; border-left-color: rgb(255, 255, 255); border-right-color: rgb(255, 255, 255); border-top-color: rgb(255, 255, 255); border-bottom-color: rgb(255, 255, 255); background-color: rgb(52, 152, 219);">
<ui:VisualElement name="Dragger" class="slider-horizontal-dragger" style="display: none;" />
</ui:VisualElement>
</ui:VisualElement>
</ui:VisualElement>
</ui:VisualElement>
<ui:VisualElement style="position: absolute; left: 0; top: 0; right: 0; bottom: 0;" />
</ui:UXML>
@@ -1,10 +0,0 @@
fileFormatVersion: 2
guid: fb5d6f3bc717b0d4d9de29e39c671f95
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
-8
View File
@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 6b0fac07849d878469a618a9f46810a7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,79 +0,0 @@
.message-panel {
flex-grow: 1;
align-items: center;
justify-content: space-around;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
display: flex;
opacity: 1;
transition-duration: 0.2s;
background-color: rgba(0, 0, 0, 0.5);
}
.message-panel-bg {
width: 300px;
height: 200px;
background-color: rgb(229, 229, 229);
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
border-top-width: 2px;
border-right-width: 2px;
border-bottom-width: 2px;
border-left-width: 2px;
border-left-color: rgb(0, 0, 0);
border-right-color: rgb(0, 0, 0);
border-top-color: rgb(0, 0, 0);
border-bottom-color: rgb(0, 0, 0);
align-items: center;
}
.message-panel-content {
margin-top: 0;
margin-right: 0;
margin-bottom: 0;
margin-left: 0;
padding-top: 10px;
padding-right: 10px;
padding-bottom: 10px;
padding-left: 10px;
width: 100%;
height: 100%;
-unity-text-align: middle-center;
font-size: 24px;
white-space: normal;
}
.message-panel-button {
margin-top: 0;
margin-right: 0;
margin-bottom: 0;
margin-left: 0;
padding-top: 0;
padding-right: 0;
padding-bottom: 0;
padding-left: 0;
border-top-width: 2px;
border-right-width: 2px;
border-bottom-width: 2px;
border-left-width: 2px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
border-left-color: rgb(0, 0, 0);
border-right-color: rgb(0, 0, 0);
border-top-color: rgb(0, 0, 0);
border-bottom-color: rgb(0, 0, 0);
width: 80px;
height: 35px;
transition-duration: 0.2s;
}
.message-panel-button:hover {
scale: 1.1 1.1;
}
@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: da034b9f31c3a734d8e1b216d1204e37
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
disableValidation: 0
@@ -1,8 +0,0 @@
<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/UI%20Toolkit/GamePopup/Message/Message.uss?fileID=7433441132597879392&amp;guid=da034b9f31c3a734d8e1b216d1204e37&amp;type=3#Message" />
<ui:VisualElement name="Message1" picking-mode="Ignore" class="message-panel">
<ui:VisualElement name="BG" class="message-panel-bg">
<ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="Content" class="message-panel-content" />
</ui:VisualElement>
</ui:VisualElement>
</ui:UXML>
@@ -1,10 +0,0 @@
fileFormatVersion: 2
guid: abba321009af7374fab0573063390012
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
@@ -1,9 +0,0 @@
<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/UI%20Toolkit/GamePopup/Message/Message.uss?fileID=7433441132597879392&amp;guid=da034b9f31c3a734d8e1b216d1204e37&amp;type=3#Message" />
<ui:VisualElement name="Message" picking-mode="Ignore" class="message-panel">
<ui:VisualElement name="BG" class="message-panel-bg">
<ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="Content" class="message-panel-content" style="height: 70%;" />
<ui:Button text="确认" parse-escape-sequences="true" display-tooltip-when-elided="true" name="Button" class="message-panel-button" />
</ui:VisualElement>
</ui:VisualElement>
</ui:UXML>
@@ -1,10 +0,0 @@
fileFormatVersion: 2
guid: 64c8f6a9923ad4342a545b1d220ac33e
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
@@ -1,12 +0,0 @@
<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/UI%20Toolkit/GamePopup/Message/Message.uss?fileID=7433441132597879392&amp;guid=da034b9f31c3a734d8e1b216d1204e37&amp;type=3#Message" />
<ui:VisualElement name="Message" picking-mode="Ignore" class="message-panel">
<ui:VisualElement name="BG" class="message-panel-bg">
<ui:Label tabindex="-1" text="Label" parse-escape-sequences="true" display-tooltip-when-elided="true" name="Content" class="message-panel-content" style="height: 70%;" />
<ui:VisualElement style="height: 30%; width: 100%; flex-direction: row; align-items: flex-start; justify-content: space-around;">
<ui:Button text="确认" parse-escape-sequences="true" display-tooltip-when-elided="true" name="Button1" class="message-panel-button" />
<ui:Button text="取消" parse-escape-sequences="true" display-tooltip-when-elided="true" name="Button2" class="message-panel-button" />
</ui:VisualElement>
</ui:VisualElement>
</ui:VisualElement>
</ui:UXML>
@@ -1,10 +0,0 @@
fileFormatVersion: 2
guid: d0d62b55e75a5814b88ba5b20ee9ce0e
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
@@ -1,11 +0,0 @@
<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:Template name="Item" src="project://database/Assets/UI%20Toolkit/GamePanel/ShortcutMenu/ItemTemplate.uxml?fileID=9197481963319205126&amp;guid=1ee167986f6e9a840a45450b4b6adfc2&amp;type=3#ItemTemplate" />
<Style src="project://database/Assets/UI%20Toolkit/GamePanel/ShortcutMenu/ShortcutMenu.uss?fileID=7433441132597879392&amp;guid=a53da9fc389948e40ac96af14dd02c10&amp;type=3#ShortcutMenu" />
<ui:VisualElement name="Container" style="background-color: rgb(255, 255, 255); border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; align-self: flex-start;">
<ui:Instance template="Item" name="Item" />
<ui:Instance template="Item" name="Item" />
<ui:Instance template="Item" name="Item" />
<ui:Instance template="Item" name="Item" />
<ui:Instance template="Item" name="Item" />
</ui:VisualElement>
</ui:UXML>