1
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3b40698060c8e254aab487e84fd0f2e8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
using MuHua;
|
||||
|
||||
/// <summary>
|
||||
/// 弹出窗口
|
||||
/// </summary>
|
||||
public class UIPopup : ModuleUIPanel {
|
||||
|
||||
private Action callback;
|
||||
|
||||
public VisualElement GamePopup => Q<VisualElement>("GamePopup");
|
||||
|
||||
public VisualElement Top => Q<VisualElement>("Top");
|
||||
public Label Title => Top.Q<Label>("Title");
|
||||
public VisualElement Container => Top.Q<VisualElement>("Container");
|
||||
|
||||
public VisualElement Bottom => Q<VisualElement>("Bottom");
|
||||
public VisualElement Button => Bottom.Q<VisualElement>("Button");
|
||||
|
||||
public UIPopup(VisualElement element) : base(element) {
|
||||
Button.RegisterCallback<ClickEvent>((evt) => ButtonClick());
|
||||
}
|
||||
|
||||
/// <summary> 按钮点击 </summary>
|
||||
public virtual void ButtonClick() {
|
||||
Settings(false);
|
||||
callback?.Invoke();
|
||||
callback = null;
|
||||
}
|
||||
|
||||
/// <summary> 设置活动状态 </summary>
|
||||
public virtual void Settings(bool active, string content = "", Action callback = null) {
|
||||
GamePopup.EnableInClassList("gamepopup-hide", !active);
|
||||
if (!active) { return; }
|
||||
Title.text = content;
|
||||
this.callback = callback;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ed2066d85ddf89443a608b697b3dbf30
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,30 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
using MuHua;
|
||||
|
||||
/// <summary>
|
||||
/// 加载进度
|
||||
/// </summary>
|
||||
public class UIProgres : ModuleUIPanel {
|
||||
|
||||
public UISliderH progress;
|
||||
|
||||
public VisualElement Progress => element.Q<VisualElement>("Progress");
|
||||
public Label Title => Progress.Q<Label>("Title");
|
||||
|
||||
public UIProgres(VisualElement element) : base(element) {
|
||||
progress = new UISliderH(Progress, element);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置进度(0-1)
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
public void Settings(bool active, string content = "", float value = 0) {
|
||||
Title.text = content;
|
||||
progress.UpdateValue(value, false);
|
||||
element.EnableInClassList("document-page-hide", !active);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3691f81ba66e3764d8e341abf37fa35a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -23,7 +23,7 @@ namespace MuHua {
|
||||
public T value;
|
||||
public List<T> list = new List<T>();
|
||||
|
||||
internal UIScrollView scrollView;
|
||||
internal UIScrollViewV scrollView;
|
||||
internal ModuleUIItems<UIDropdownItem, T> DropdownItems;
|
||||
|
||||
/// <summary> 数据操作 </summary
|
||||
@@ -50,7 +50,7 @@ namespace MuHua {
|
||||
DropdownScrollView.EnableInClassList("dropdown-hide", false);
|
||||
DropdownContainer.Add(DropdownScrollView);
|
||||
|
||||
scrollView = new UIScrollView(DropdownScrollView, DropdownContainer);
|
||||
scrollView = new UIScrollViewV(DropdownScrollView, DropdownContainer);
|
||||
DropdownItems = new ModuleUIItems<UIDropdownItem, T>(scrollView.Container, TemplateAsset,
|
||||
(data, element) => new UIDropdownItem(data, element, this));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user