rj-action-library/Runtime/UI/Nodes/UIHolder.cs

21 lines
420 B
C#
Raw Normal View History

2025-06-19 17:22:25 +00:00
using Godot;
using Rokojori;
using System.Collections.Generic;
namespace Rokojori
{
public interface UIHolderControl
{
2025-06-23 11:16:01 +00:00
public void SetUI( UI ui, bool computeDepth = true );
public UI GetUI( bool computeDepth = true );
2025-06-19 17:22:25 +00:00
}
public class UIHolder
{
public static UI GetUI( Control c )
{
return c is UIHolderControl ? ( (UIHolderControl)c ).GetUI() : c.FindParentThatIs<UI>();
}
}
}