예제 #1
0
        // Dialog that opens another dialog right after
        public void Dialog_That_Opens_Another_Dialog()
        {
            List <SimpleUIDialogAction> dialogActions = new List <SimpleUIDialogAction>
            {
                new SimpleUIDialogAction(delegate { Dialog_With_OK_Button(); }, "Open another Dialog")
            };

            SimpleUIPrompt.ShowDialog("Simple UI Dialog", "Increment A by 1", dialogActions, 1, false);
        }
예제 #2
0
        // Dialog with multiple delegates in a button
        public void Dialog_With_Multiple_Delegates()
        {
            List <SimpleUIDialogAction> dialogActions = new List <SimpleUIDialogAction>
            {
                new SimpleUIDialogAction(delegate { a++; b++; }, "YES")
            };

            SimpleUIPrompt.ShowDialog("Simple UI Dialog", "Increment A & B by 1?", dialogActions);
        }
예제 #3
0
        // Simple dialog that has a single button with empty delegates (no action)
        public void Dialog_With_OK_Button()
        {
            List <SimpleUIDialogAction> dialogActions = new List <SimpleUIDialogAction>
            {
                new SimpleUIDialogAction(delegate { }, "Ok")
            };

            SimpleUIPrompt.ShowDialog("Simple UI Dialog", "Hello There again!", dialogActions);
        }
예제 #4
0
        // Dialog with highlighted button and "X" disabled
        // Highlight a button by writing its index (starts with 1)
        public void Dialog_With_X_Turned_Off_And_Highlighted_Btn()
        {
            List <SimpleUIDialogAction> dialogActions = new List <SimpleUIDialogAction>
            {
                new SimpleUIDialogAction(delegate { b++; }, "Increment B"), // <- Highlighting this Button
                new SimpleUIDialogAction(delegate { b--; }, "Decrement B")
            };

            SimpleUIPrompt.ShowDialog("Simple UI Dialog", "Select your options", dialogActions, 1, false);
        }
예제 #5
0
        // Dialog with multiple buttons with delegates
        public void Dialog_With_Actions()
        {
            List <SimpleUIDialogAction> dialogActions = new List <SimpleUIDialogAction>
            {
                new SimpleUIDialogAction(delegate { a++; }, "Increment A"),
                new SimpleUIDialogAction(delegate { a--; }, "Decrement A"),
                new SimpleUIDialogAction(delegate { b++; }, "Increment B"),
                new SimpleUIDialogAction(delegate { b--; }, "Decrement B")
            };

            SimpleUIPrompt.ShowDialog("Simple UI Dialog", "Increment A by 1", dialogActions);
        }
예제 #6
0
        private void OnEnable()
        {
            if (!instance)
            {
                instance = this;
            }
            else
            {
                Destroy(gameObject);
            }

            DontDestroyOnLoad(gameObject);
            dialogPanelAnimator.ScaleAnimSpd = animationSpd;
            gameObject.name = "SimpleUIPromptCanvas";
        }
예제 #7
0
 private void OnDestroy()
 {
     instance = null;
 }
예제 #8
0
 // Simple dialog that only needs the title and content parameter
 public void Dialog_Without_Actions()
 {
     SimpleUIPrompt.ShowDialog("Simple UI Dialog", "Hello There!");
 }