Browse Source

随机角色名

zhaoyang 3 years ago
parent
commit
8529cdb272

+ 8 - 4
GameClient/Assets/Game/HotUpdate/Views/CreateRole/CreateRoleView.cs

@@ -2,6 +2,7 @@ using FairyGUI;
 using UI.CreateRole;
 using UI.CreateRole;
 using System;
 using System;
 using System.Text.RegularExpressions;
 using System.Text.RegularExpressions;
+using ET;
 
 
 namespace GFGGame
 namespace GFGGame
 {
 {
@@ -13,7 +14,7 @@ namespace GFGGame
         {
         {
             base.Dispose();
             base.Dispose();
         }
         }
-        
+
         protected override void OnInit()
         protected override void OnInit()
         {
         {
             base.OnInit();
             base.OnInit();
@@ -25,7 +26,8 @@ namespace GFGGame
             this.modal = true;
             this.modal = true;
 
 
             _ui.m_btnSure.onClick.Add(OnClickBtnSure);
             _ui.m_btnSure.onClick.Add(OnClickBtnSure);
-            _ui.m_btnDice.onClick.Add(() => {
+            _ui.m_btnDice.onClick.Add(() =>
+            {
                 RandomRoleName();
                 RandomRoleName();
             });
             });
         }
         }
@@ -65,9 +67,11 @@ namespace GFGGame
             LoginController.ReqCreateRole(roleName).Coroutine();
             LoginController.ReqCreateRole(roleName).Coroutine();
         }
         }
 
 
-        private void RandomRoleName()
+        private async void RandomRoleName()
         {
         {
-            _ui.m_inputName.text = RoleDataManager.RandomRoleName();
+            string name = await LoginHelper.ReqRandomRoleName();
+
+            _ui.m_inputName.text = name;
         }
         }
 
 
     }
     }