Beispiel #1
0
        /// <summary>
        /// Creates an info popup from a resource path.
        /// </summary>
        public static InfoPopup CreateFromResource(string prefabPath, System.Action onCloseCB)
        {
            GameObject goPopup = Instantiate(Resources.Load <GameObject>(prefabPath));
            InfoPopup  popup   = goPopup.GetComponent <InfoPopup>();

            popup._OnCloseCB = onCloseCB;

            return(popup);
        }
Beispiel #2
0
        /// <summary>
        /// Creates an info popup.
        /// </summary>
        public static InfoPopup Create(string message, System.Action onCloseCB)
        {
            GameObject goPopup = Instantiate(Resources.Load <GameObject>(PrefabPath));
            InfoPopup  popup   = goPopup.GetComponent <InfoPopup>();

            popup._OnCloseCB        = onCloseCB;
            popup._MessageText.text = message;

            return(popup);
        }