safer UIRoot visibility check

This commit is contained in:
Sinai 2021-04-16 02:46:21 +10:00
parent f89455549e
commit 8ef6df043c

View File

@ -12,8 +12,8 @@ namespace UnityExplorer.UI.Models
public bool Visible
{
get => UIRoot?.activeInHierarchy ?? false;
set => UIRoot?.SetActive(value);
get => UIRoot && UIRoot.activeInHierarchy;
set { if (UIRoot) UIRoot.SetActive(value); }
}
public abstract void ConstructUI(GameObject parent);