using UnityEngine;
using XGame.Framework.ObjectCollection;
namespace XGame.Framework.UI
{
///
/// UGUI的实现
///
[DisallowMultipleComponent]
[AddComponentMenu("XGame/UI/UIPanel")]
public class UIPanel : MonoBehaviour, IUIPanel, IComponentGetter
{
[SerializeField]
private ObjectCollector _collector = new ObjectCollector();
[SerializeField]
private UILayer _layer = UILayer.Normal;
#region IUIPanel 接口实现
public UILayer Layer => _layer;
void IUIPanel.SetActive(bool isActive)
{
gameObject.SetActive(isActive);
}
#endregion
T IComponentGetter.GetComponent(string key)
{
return _collector.GetComponent(key);
}
//#region IObjectCollector 接口实现
//Object IObjectCollector.this[string key] => _collector[key];
//List IObjectCollector.Keys => _collector.Keys;
//List