Skip to content

Commit 9b64b6b

Browse files
committed
feat(FairyGUI): 添加界面组深度支持并更新Handler方法
在FairyGUIUIGroupHelper中添加Depth属性来存储界面组深度 修改Handler方法签名,增加depth参数并默认设为0 在Handler方法中调用SetDepth来初始化界面组深度
1 parent f117669 commit 9b64b6b

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

Runtime/FairyGUIUIGroupHelper.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,32 @@ namespace GameFrameX.UI.FairyGUI.Runtime
4141
[UnityEngine.Scripting.Preserve]
4242
public sealed class FairyGUIUIGroupHelper : UIGroupHelperBase
4343
{
44+
/// <summary>
45+
/// 获取界面组深度。
46+
/// </summary>
47+
public override int Depth { get; protected set; }
48+
4449
/// <summary>
4550
/// 设置界面组深度。
4651
/// </summary>
4752
/// <param name="depth">界面组深度。</param>
4853
public override void SetDepth(int depth)
4954
{
55+
Depth = depth;
5056
transform.localPosition = new Vector3(0, 0, depth * 100);
5157
}
5258

53-
public override IUIGroupHelper Handler(Transform root, string groupName, string uiGroupHelperTypeName, IUIGroupHelper customUIGroupHelper)
59+
/// <summary>
60+
/// 创建界面组。
61+
/// </summary>
62+
/// <param name="root">根节点。</param>
63+
/// <param name="groupName">界面组名称。</param>
64+
/// <param name="uiGroupHelperTypeName">界面组辅助器类型名。</param>
65+
/// <param name="customUIGroupHelper">自定义的界面组辅助器.</param>
66+
/// <param name="depth">界面组深度。</param>
67+
public override IUIGroupHelper Handler(Transform root, string groupName, string uiGroupHelperTypeName, IUIGroupHelper customUIGroupHelper, int depth = 0)
5468
{
69+
SetDepth(depth);
5570
GComponent component = new GComponent();
5671
GRoot.inst.AddChild(component);
5772
var comName = groupName;

0 commit comments

Comments
 (0)