示例#1
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);
        }