Skip to content

Commit c55dd68

Browse files
committed
Shorten the signature of Show* to Show
1 parent 61850d8 commit c55dd68

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

src/UnityPackage/Assets/UiManagerSample/UiManagerSample.cs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ protected void Awake()
1313

1414
public void OnMessageBoxClick()
1515
{
16-
UiMessageBox.ShowMessageBox("This is a message <b>box</b>", _ =>
16+
UiMessageBox.Show("This is a message <b>box</b>", _ =>
1717
{
1818
_logger.Info("MessageBox done");
1919
});
2020
}
2121

2222
public void OnMessageQuestionBoxClick()
2323
{
24-
UiMessageBox.ShowQuestionBox("This is a message question <b>box</b>", UiMessageBox.QuestionType.OkCancel, r =>
24+
UiMessageBox.Show("This is a message question <b>box</b>", UiMessageBox.QuestionType.OkCancel, r =>
2525
{
2626
_logger.InfoFormat("MessageQuestionBox done with {0}", r);
2727
});
@@ -36,31 +36,39 @@ private IEnumerator ShowMessageQuestionBoxCoroutine()
3636
{
3737
while (true)
3838
{
39-
var handle = UiMessageBox.ShowQuestionBox("Do you want to continue?", UiMessageBox.QuestionType.ContinueStop);
39+
var handle = UiMessageBox.Show("Do you want to continue?", UiMessageBox.QuestionType.ContinueStop);
4040
yield return StartCoroutine(handle.WaitForHide());
4141
_logger.Info(handle.ReturnValue);
4242
if ((UiMessageBox.QuestionResult)handle.ReturnValue == UiMessageBox.QuestionResult.Continue)
4343
{
44-
var handle2 = UiMessageBox.ShowMessageBox("Let's do it again");
44+
var handle2 = UiMessageBox.Show("Let's do it again");
4545
yield return StartCoroutine(handle2.WaitForHide());
4646
}
4747
else
4848
{
49-
UiMessageBox.ShowMessageBox("Done");
49+
UiMessageBox.Show("Done");
5050
yield break;
5151
}
5252
}
5353
}
5454

55+
public void OnInputBoxClick()
56+
{
57+
UiInputBox.Show("Please input your name:", "Bill", callback: value =>
58+
{
59+
UiMessageBox.Show("Your name: " + (value ?? "Canceled"));
60+
});
61+
}
62+
5563
public void OnTestDialogBoxClick()
5664
{
5765
var handle = UiManager.Instance.ShowModalRoot<TestDialogBox>("Input your name?");
5866
handle.Hidden += (dlg, val) =>
5967
{
6068
if (val != null)
61-
UiMessageBox.ShowMessageBox("Name: " + val);
69+
UiMessageBox.Show("Name: " + val);
6270
else
63-
UiMessageBox.ShowMessageBox("Canceled");
71+
UiMessageBox.Show("Canceled");
6472
};
6573
}
6674
}

0 commit comments

Comments
 (0)