using System; using System.Collections.Generic; using UnityEditor; using UnityEngine; public abstract class PanelController : MonoBehaviour, PanelControllerInterface { [Header("Panel Information")] [SerializeField] protected GameObject _panelContent; //[SerializeField] private TaskBox TaskBoxTemplate; [SerializeField] protected GameObject ChildBoxTemplate; [SerializeField] protected List ChildBoxList; /// /// Fetch reference to static instance of UiManager script /// private static UIBaseManager _uiManager; protected UIBaseManager UiManager { get { if (_uiManager == null) { return FetchUiManager(); } return null; } } // TODO decide whick method use and where bind object with itself // public abstract void Bind(ManagerInterface manager); protected abstract UIBaseManager FetchUiManager(); public virtual void SetUp(List elements) { BuildPanelSlots(); BuildPanelContent(elements); } public virtual void BuildPanelContent(List elements) { if (_panelContent == null) throw new Exception("Panel content is not attaches"); } public abstract void BuildPanelSlots(); public abstract GameObject BuildSlot(int key, GameObject _parent); public abstract void ClearSlots(); }