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

            dialog.Initialize();
            return(dialog);
        }
예제 #2
0
        /// <summary>
        /// Shows an simple list dialog with an optional title, optional icon, and a required scrollable option list.
        /// <para></para>
        /// For more customizability, use <see cref="CreateSimpleList"/>.
        /// </summary>
        /// <param name="optionDataList">The data to use for the option list.</param>
        /// <param name="onItemClick">Called when an option is selected.</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>
        /// <returns>The instance of the initialized, shown dialog.</returns>
        public static DialogSimpleList ShowSimpleList(OptionDataList optionDataList, Action <int> onItemClick, string titleText, ImageData icon)
        {
            DialogSimpleList dialog = CreateSimpleList();

            dialog.Initialize(optionDataList, onItemClick, titleText, icon);
            dialog.Show();
            return(dialog);
        }