using UnityEngine; using UnityEngine.UI; using System.Collections; public class PopUpUtil : MonoBehaviour { private Color color; private float bga = -1; private Image bg = null; private bool playAnimationEnd; public static System.Random random = new System.Random(); void OnDestroy () { PopUpManager.UpdateModal(); } void Start() { //transform.GetComponent().type; PopUpPanel popupPanel = transform.GetComponent(); bg = popupPanel.backGround; playAnimationEnd = popupPanel.PlayAnimationEnd; if (!popupPanel.PlayAnimationStart) { return; } if (bg != null) { color = bg.color; bga = bg.color.a; color.a = 0; bg.color = color; } } public void Close() { if (!playAnimationEnd) { Destroy(this.gameObject); return; } if (bg != null) { color.a = 0; } else { CloseMove(); } } private void CloseMove() { } }