예제 #1
0
        /// <summary>
        /// Instantiates a dialog and passes it a result
        /// </summary>
        /// <param name="dialogPrefab"></param>
        /// <param name="result"></param>
        /// <returns></returns>
        public static SimpleDialog Open(GameObject dialogPrefab, SimpleDialogResult result)
        {
            GameObject   dialogGo = GameObject.Instantiate(dialogPrefab) as GameObject;
            SimpleDialog dialog   = dialogGo.GetComponent <SimpleDialog>();

            dialog.Launch(result);
            return(dialog);
        }
예제 #2
0
        protected void Launch(SimpleDialogResult newResult)
        {
            if (state != StateEnum.Uninitialized)
            {
                return;
            }

            result = newResult;
            StartCoroutine(RunDialogOverTime());
        }
예제 #3
0
        /// <summary>
        /// Instantiates a dialog and passes a generated result
        /// </summary>
        /// <param name="dialogPrefab"></param>
        /// <param name="buttons"></param>
        /// <param name="title"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public static SimpleDialog Open(GameObject dialogPrefab, ButtonTypeEnum buttons, string title, string message)
        {
            GameObject         dialogGo = GameObject.Instantiate(dialogPrefab) as GameObject;
            SimpleDialog       dialog   = dialogGo.GetComponent <SimpleDialog>();
            SimpleDialogResult result   = new SimpleDialogResult();

            result.Buttons = buttons;
            result.Title   = title;
            result.Message = message;
            dialog.Launch(result);
            return(dialog);
        }