mirror of
https://github.com/GrahamKracker/UnityExplorer.git
synced 2025-07-05 21:02:24 +08:00
28 lines
582 B
C#
28 lines
582 B
C#
![]() |
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);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|