增加UIToggle和UIDropdown

This commit is contained in:
MuHua-123
2025-04-22 15:45:57 +08:00
parent f6d1cd4d87
commit 9a34f2bd18
33 changed files with 755 additions and 32 deletions
@@ -23,14 +23,12 @@ namespace MuHua {
public readonly UIScrollerFunc scrollerFunc;
public readonly VisualElement Dragger;
public VisualElement Dragger => Q<VisualElement>("Dragger");
public UIScroller(VisualElement element, VisualElement canvas, UIDirection direction = UIDirection.FromLeftToRight) : base(element) {
this.canvas = canvas;
this.direction = direction;
Dragger = element.Q<VisualElement>("Dragger");
if (direction == UIDirection.FromLeftToRight) { scrollerFunc = new FromLeftToRight(this); }
if (direction == UIDirection.FromRightToLeft) { scrollerFunc = new FromRightToLeft(this); }
if (direction == UIDirection.FromTopToBottom) { scrollerFunc = new FromTopToBottom(this); }