123456789101112131415161718192021222324252627282930 |
- using UnityEngine;
- using XGame.Framework.ObjectCollection;
- namespace XGame.Framework.UI
- {
- [DisallowMultipleComponent]
- [AddComponentMenu("XGame/UI/UINested")]
- public class UINested : MonoBehaviour, IUINested, IComponentGetter
- {
- [SerializeField]
- private ObjectCollector _collector = new ObjectCollector();
- Transform IUINested.Tr => transform;
- bool IUINested.IsActiveSelf => gameObject.activeSelf;
- bool IUINested.IsActiveInHierarchy => gameObject.activeInHierarchy;
- void IUINested.SetActive(bool isActive)
- {
- gameObject.SetActive(isActive);
- }
- T IComponentGetter.GetComponent<T>(string key)
- {
- return _collector.GetComponent<T>(key);
- }
- }
- }
|