Files
UnityExplorer_Fix/src/UI/Model/UIModel.cs

28 lines
582 B
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
namespace UnityExplorer.UI.Models
{
public abstract class UIModel
{
public abstract GameObject UIRoot { get; }
public bool Visible
{
get => UIRoot?.activeInHierarchy ?? false;
set => UIRoot?.SetActive(value);
}
public abstract void ConstructUI(GameObject parent);
public virtual void Destroy()
{
if (UIRoot)
GameObject.Destroy(UIRoot);
}
}
}