UIWidget增加Visible设置

UIWidget增加Visible设置
This commit is contained in:
ALEXTANG
2023-12-07 16:32:54 +08:00
parent 5d67238c8f
commit edf4925a7a

View File

@@ -52,6 +52,20 @@ namespace TEngine
return null;
}
}
/// <summary>
/// 窗口可见性
/// </summary>
public bool Visible
{
get => gameObject.activeSelf;
set
{
gameObject.SetActive(value);
OnSetVisible(value);
}
}
internal bool InternalUpdate()
{
@@ -205,6 +219,13 @@ namespace TEngine
{
gameObject.SetActive(false);
}
else
{
if (!gameObject.activeSelf)
{
gameObject.SetActive(true);
}
}
return true;
}