File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/UnityPackage/Assets/UiManager Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ public enum QuestionResult
2929 public Text MessageText ;
3030 public Button [ ] Buttons ;
3131
32- public static UiDialogHandle ShowMessageBox ( string msg , QuestionResultDelegate callback = null )
32+ public static UiDialogHandle Show ( string msg , QuestionResultDelegate callback = null )
3333 {
3434 UiDialogHandle handle ;
3535 {
@@ -60,7 +60,7 @@ private void OnMessageBoxOkButtonClick()
6060 Hide ( QuestionResult . Ok ) ;
6161 }
6262
63- public static UiDialogHandle ShowQuestionBox (
63+ public static UiDialogHandle Show (
6464 string msg , QuestionType questionType ,
6565 QuestionResultDelegate callback = null , string customOkName = null )
6666 {
@@ -89,15 +89,18 @@ public static UiDialogHandle ShowQuestionBox(
8989 var b1 = msgBox . Buttons [ 1 ] ;
9090 var b1Text = b1 . transform . Find ( "Text" ) . GetComponent < Text > ( ) ;
9191
92+ b1 . gameObject . SetActive ( questionType != QuestionType . Ok ) ;
93+
9294 switch ( questionType )
9395 {
9496 case QuestionType . Ok :
9597 b0Text . text = customOkName ?? "Ok" ;
9698 b0 . onClick . AddListener ( ( ) => msgBox . OnQuestionBoxButtonClick ( QuestionResult . Ok ) ) ;
99+ b1 . gameObject . SetActive ( false ) ;
97100 break ;
98101
99102 case QuestionType . OkCancel :
100- b0Text . text = "Ok" ;
103+ b0Text . text = customOkName ?? "Ok" ;
101104 b0 . onClick . AddListener ( ( ) => msgBox . OnQuestionBoxButtonClick ( QuestionResult . Ok ) ) ;
102105 b1Text . text = "Cancel" ;
103106 b1 . onClick . AddListener ( ( ) => msgBox . OnQuestionBoxButtonClick ( QuestionResult . Cancel ) ) ;
You can’t perform that action at this time.
0 commit comments