21 lines
367 B
C#
21 lines
367 B
C#
![]() |
|
||
|
using Godot;
|
||
|
using Rokojori;
|
||
|
using System.Collections.Generic;
|
||
|
|
||
|
namespace Rokojori
|
||
|
{
|
||
|
public interface UIHolderControl
|
||
|
{
|
||
|
public void SetUI( UI ui);
|
||
|
public UI GetUI();
|
||
|
}
|
||
|
|
||
|
public class UIHolder
|
||
|
{
|
||
|
public static UI GetUI( Control c )
|
||
|
{
|
||
|
return c is UIHolderControl ? ( (UIHolderControl)c ).GetUI() : c.FindParentThatIs<UI>();
|
||
|
}
|
||
|
}
|
||
|
}
|