PopUpPanel.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using System.Collections;
  4. public abstract class PopUpPanel : MonoBehaviour
  5. {
  6. private bool _modal;
  7. public Image backGround;
  8. public bool PlayAnimationStart = true;
  9. public bool PlayAnimationEnd = true;
  10. public bool NoEspScale = false;
  11. public enum Type : int
  12. {
  13. NONE = -1,
  14. SCALE_UP = 0,
  15. SCALE_DOWN = 1,
  16. ROTATION_Y = 2,
  17. ROSITION_X_UP = 3,
  18. ROSITION_X_DOWN = 4,
  19. ROSITION_Y_UP = 5,
  20. ROSITION_Y_DOWN = 6,
  21. }
  22. public void InitBackGround(Transform BG)
  23. {
  24. backGround = BG.GetComponent<Image>();
  25. }
  26. public Type type = Type.NONE;
  27. public bool modal
  28. {
  29. set{_modal = value;}
  30. get{return _modal;}
  31. }
  32. public virtual void Added()
  33. {
  34. }
  35. public virtual void Remove()
  36. {
  37. Destroy(this.gameObject);
  38. PopUpManager.UpdateModal();
  39. }
  40. /// <summary>
  41. /// ±ØÐëµ÷Óà OnClose·½·¨
  42. /// </summary>
  43. public abstract void Close();
  44. public void OnClose()
  45. {
  46. PopUpUtil popUpUtil = this.GetComponent<PopUpUtil>();
  47. if (popUpUtil != null)
  48. {
  49. popUpUtil.Close();
  50. }
  51. else
  52. {
  53. Destroy(this.gameObject);
  54. }
  55. }
  56. }