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

21 lines
420 B
C#

using Godot;
using Rokojori;
using System.Collections.Generic;
namespace Rokojori
{
public interface UIHolderControl
{
public void SetUI( UI ui, bool computeDepth = true );
public UI GetUI( bool computeDepth = true );
}
public class UIHolder
{
public static UI GetUI( Control c )
{
return c is UIHolderControl ? ( (UIHolderControl)c ).GetUI() : c.FindParentThatIs<UI>();
}
}
}