using UnityEngine; using System.Collections; public class PopUpPanel : MonoBehaviour { private bool _modal; public bool modal { set{_modal = value;} get{return _modal;} } public void Open() { BeforeShow (); Animator animator = GetComponent(); if(animator != null) animator.Play("PanelShow", 0, 0); else OpenComplete(); } public void OpenComplete() { Shown (); } protected virtual void BeforeShow() { } protected virtual void Shown() { } public void Close() { Animator animator = GetComponent(); if(animator != null) animator.Play("PanelHide", 0, 0); else CloseComplete(); } public void CloseComplete() { Remove (); } protected virtual void Remove() { Destroy(this.gameObject); PopUpManager.UpdateModal(); } }