public static popupWindow Instance() { if (!modalPanel) { modalPanel = FindObjectOfType(typeof(popupWindow)) as popupWindow; if (!modalPanel) { Debug.LogError("There has to be one popup window on a GameObject."); } } return(modalPanel); }
void Awake() { popup = popupWindow.Instance(); checkAction = new UnityAction(myCheck); cancelAction = new UnityAction(myCancel); }