Example #1
0
        /// <summary>
        /// Setup for the First Time Stup dialog.
        /// </summary>
        public static void FirstTimeDialog(int width, int height)
        {
            ConventionKeeperPopup window = ScriptableObject.CreateInstance <ConventionKeeperPopup>();

            width  = (width == 0) ? Mathf.RoundToInt(Screen.currentResolution.width * 0.5f) : width;
            height = (height == 0) ? Mathf.RoundToInt(Screen.currentResolution.height * 0.5f) : height;

            window.position = new Rect(Screen.currentResolution.width / 2 - width / 2, Screen.currentResolution.height / 2 - height / 2, width, height);

            window.title   = "Hello!";
            window.message = "We need to setup Convention Keeper to support your project convention needs!\n" +
                             "\n" +
                             "What do you want to do?";

            window.drawFunction = new Action(window.DrawFirstTimeDialog);

            window.ShowPopup();
        }
Example #2
0
        /// <summary>
        /// Setup for the N input buttons dialog.
        /// </summary>
        public static void Dialog(string title, string message, List <ButtonData> buttonList, int width = 0, int height = 0, Color customBGColor = new Color())
        {
            ConventionKeeperPopup window = ScriptableObject.CreateInstance <ConventionKeeperPopup>();

            width  = (width == 0) ? Mathf.RoundToInt(Screen.currentResolution.width * 0.5f) : width;
            height = (height == 0) ? Mathf.RoundToInt(Screen.currentResolution.height * 0.5f) : height;

            window.position = new Rect(Screen.currentResolution.width / 2 - width / 2, Screen.currentResolution.height / 2 - height / 2, width, height);

            window.title   = title;
            window.message = message;

            window.buttonList = buttonList;

            window.drawFunction = new Action(window.DrawDialog);

            window.backgroundColor = customBGColor;

            window.ShowPopup();
        }
Example #3
0
        /// <summary>
        /// Setup for the 2 input buttons and 1 input field dialog.
        /// </summary>
        public static void DialogWithInputField(string title, string message, string inputInitialText, ButtonData ok, ButtonData cancel, int width = 0, int height = 0)
        {
            ConventionKeeperPopup window = ScriptableObject.CreateInstance <ConventionKeeperPopup>();

            width  = (width == 0) ? Mathf.RoundToInt(Screen.currentResolution.width * 0.5f) : width;
            height = (height == 0) ? Mathf.RoundToInt(Screen.currentResolution.height * 0.5f) : height;

            window.position = new Rect(Screen.currentResolution.width / 2 - width / 2, Screen.currentResolution.height / 2 - height / 2, width, height);

            window.title   = title;
            window.message = message;

            window.buttonList = new List <ButtonData>();
            window.buttonList.Add(ok);
            window.buttonList.Add(cancel);

            window.inputFieldFirstText = inputInitialText;
            window.inputFieldText      = inputInitialText;

            window.drawFunction = new Action(window.DrawDialogWithInputField);

            window.ShowPopup();
        }