using UnityEngine;
using System.Collections;
public abstract class BasePanel : MonoBehaviour
{
//panel State
protected E_PanelState _panelState;
public E_PanelState PanelState
{
get
{
return _panelState;
}
set
{
E_PanelState old = this._panelState;
this._panelState = value;
if (this._panelState != old)
{
OnStateChange(old, this._panelState);
}
}
}
//panel Type
protected E_PanelType _panelType;
public E_PanelType PanelType
{
get; private set;
}
public abstract void SetPanelState();
public abstract void SetPanelType();
public virtual void OnStateChange(E_PanelState oldS, E_PanelState newS)
{
}
void Start()
{
OnStart();
}
public virtual void OnStart()
{
SetPanelType();
UIManager.Instance.SavePanel(this._panelType, this.gameObject);
}
void Awake()
{
OnAwake();
}
public virtual void OnAwake()
{
}
void Update()
{
OnUpdate();
}
public virtual void OnUpdate()
{
}
}