using UnityEngine; using UnityEngine.UI; using System.Collections; public abstract class PopUpPanel : MonoBehaviour { private bool _modal; public Image backGround; public bool PlayAnimationStart = true; public bool PlayAnimationEnd = true; public bool NoEspScale = false; public enum Type : int { NONE = -1, SCALE_UP = 0, SCALE_DOWN = 1, ROTATION_Y = 2, ROSITION_X_UP = 3, ROSITION_X_DOWN = 4, ROSITION_Y_UP = 5, ROSITION_Y_DOWN = 6, } public void InitBackGround(Transform BG) { backGround = BG.GetComponent(); } public Type type = Type.NONE; public bool modal { set{_modal = value;} get{return _modal;} } public virtual void Added() { } public virtual void Remove() { Destroy(this.gameObject); PopUpManager.UpdateModal(); } /// /// 必须调用 OnClose方法 /// public abstract void Close(); public void OnClose() { PopUpUtil popUpUtil = this.GetComponent(); if (popUpUtil != null) { popUpUtil.Close(); } else { Destroy(this.gameObject); } } }