35 lines
785 B
C#
35 lines
785 B
C#
using System;
|
|
using System.Collections;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.Localization;
|
|
using UnityEngine.Localization.Components;
|
|
using UnityEngine.ResourceManagement.AsyncOperations;
|
|
|
|
namespace XRLib.UI
|
|
{
|
|
public abstract class UIBase : MonoBehaviour
|
|
{
|
|
public RectTransform rectTransform => GetComponent<RectTransform>();
|
|
public event Action<UIBase> onEnableEvent;
|
|
public event Action<UIBase> onDisableEvent;
|
|
|
|
public void SetActive(bool value)
|
|
{
|
|
gameObject.SetActive(value);
|
|
}
|
|
|
|
protected virtual void OnEnable()
|
|
{
|
|
onEnableEvent?.Invoke(this);
|
|
}
|
|
|
|
protected virtual void OnDisable()
|
|
{
|
|
onDisableEvent?.Invoke(this);
|
|
}
|
|
|
|
|
|
}
|
|
}
|