/// <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); }
/// <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); }