예제 #1
0
        /// <summary>
        /// Creates a radiobutton list dialog that can be modified or stored before showing.
        /// <para></para>
        /// Before calling <see cref="DialogRadioList.Show"/>, call <see cref="DialogRadioList.Initialize(string[],Action{int},string,string,ImageData,Action,string,int)"/>.
        /// <para></para>
        /// For a simpler solution with less customizability, use <see cref="ShowRadioList(string[],Action{int},string,string,ImageData,Action,string,int)"/>.
        /// </summary>
        /// <returns>The instance of the created dialog.</returns>
        public static DialogRadioList CreateRadioList()
        {
            DialogRadioList dialog = PrefabManager.InstantiateGameObject(PrefabManager.ResourcePrefabs.dialogRadioList, instance.transform).GetComponent <DialogRadioList>();

            dialog.Initialize();
            return(dialog);
        }
예제 #2
0
        /// <summary>
        /// Shows a radiobutton list dialog with an optional title, optional icon, a required scrollable radiobutton list, a required button, and an optional button.
        /// <para></para>
        /// For more customizability, use <see cref="CreateRadioList"/>.
        /// </summary>
        /// <param name="options">The strings to use for the list item labels.</param>
        /// <param name="onAffirmativeButtonClicked">Called when the affirmative button is clicked.</param>
        /// <param name="affirmativeButtonText">The affirmative button text.</param>
        /// <param name="titleText">The title text. Make null for no title.</param>
        /// <param name="icon">The icon next to the title. Make null for no icon.</param>
        /// <param name="onDismissiveButtonClicked">Called when the dismissive button is clicked.</param>
        /// <param name="dismissiveButtonText">The dismissive button text. Make null for no dismissive button.</param>
        /// <param name="selectedIndexStart">The index of the option that will be selected when the dialog is shown.</param>
        /// <returns>The instance of the initialized, shown dialog.</returns>
        public static DialogRadioList ShowRadioList(string[] options, Action <int> onAffirmativeButtonClicked, string affirmativeButtonText, string titleText, ImageData icon, Action onDismissiveButtonClicked, string dismissiveButtonText, int selectedIndexStart = 0)
        {
            DialogRadioList dialog = CreateRadioList();

            dialog.Initialize(options, onAffirmativeButtonClicked, affirmativeButtonText, titleText, icon, onDismissiveButtonClicked, dismissiveButtonText, selectedIndexStart);
            dialog.Show();
            return(dialog);
        }