using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace TFramework
{
    [DefaultExecutionOrder(-9998)]
    public class UIDomain : MonoBehaviour
    {
        public string m_domainName;
        public bool m_isRegister = true;

        private void Awake()
        {
            if (m_isRegister)
                Main.GetMagr<UIManager>().RegisterUIDomain(m_domainName, transform);
        }

        private void OnDestroy()
        {
            if (m_isRegister)
                Main.GetMagr<UIManager>()?.UnregisterUIDomain(m_domainName);
        }
    }
}
