29 lines
558 B
C#
29 lines
558 B
C#
|
using System;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
|
||
|
namespace BITKit.UX
|
||
|
{
|
||
|
public sealed class UGUIPanelComponent : MonoBehaviour
|
||
|
{
|
||
|
[SerializeReference, SubclassSelector] private IUXPanel panel;
|
||
|
[SerializeField] private RectTransform rectTransform;
|
||
|
private void Start()
|
||
|
{
|
||
|
panel.OnEntry += OnEntry;
|
||
|
panel.OnExit += OnExit;
|
||
|
OnExit();
|
||
|
}
|
||
|
private void OnExit()
|
||
|
{
|
||
|
rectTransform.gameObject.SetActive(false);
|
||
|
}
|
||
|
private void OnEntry()
|
||
|
{
|
||
|
rectTransform.gameObject.SetActive(true);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|