12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- 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<PopUpPanel>().type;
- PopUpPanel popupPanel = transform.GetComponent<PopUpPanel>();
- 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()
- {
-
- }
- }
|