结构大修改,改成朴实无华的结构,不过度架构。能跑就行

This commit is contained in:
2025-12-23 00:09:39 +08:00
parent 384f11f620
commit 3d14085920
2837 changed files with 149714 additions and 1100 deletions

View File

@@ -0,0 +1,55 @@
using System;
using FairyGUI.Utils;
namespace FairyGUI
{
/// <summary>
/// Gear is a connection between object and controller.
/// </summary>
public class GearDisplay2 : GearBase
{
/// <summary>
/// Pages involed in this gear.
/// </summary>
public string[] pages { get; set; }
public int condition;
int _visible;
public GearDisplay2(GObject owner)
: base(owner)
{
}
override protected void AddStatus(string pageId, ByteBuffer buffer)
{
}
override protected void Init()
{
pages = null;
}
override public void Apply()
{
if (pages == null || pages.Length == 0
|| Array.IndexOf(pages, _controller.selectedPageId) != -1)
_visible = 1;
else
_visible = 0;
}
override public void UpdateState()
{
}
public bool Evaluate(bool connected)
{
bool v = _controller == null || _visible > 0;
if (this.condition == 0)
v = v && connected;
else
v = v || connected;
return v;
}
}
}