1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- 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<Animator>();
- 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<Animator>();
- if(animator != null)
- animator.Play("PanelHide", 0, 0);
- else
- CloseComplete();
- }
- public void CloseComplete()
- {
- Remove ();
- }
-
- protected virtual void Remove()
- {
- Destroy(this.gameObject);
- PopUpManager.UpdateModal();
- }
- }
|