소스 검색

角色名字存储唯一

guodong 1 년 전
부모
커밋
84fb61b21b
2개의 변경된 파일7개의 추가작업 그리고 3개의 파일을 삭제
  1. 7 2
      GameClient/Assets/Game/HotUpdate/Data/RoleDataManager.cs
  2. 0 1
      GameClient/Assets/Game/HotUpdate/ServerProxy/RoleInfoSProxy.cs

+ 7 - 2
GameClient/Assets/Game/HotUpdate/Data/RoleDataManager.cs

@@ -8,7 +8,13 @@ namespace GFGGame
     {
         public static bool powerTimeServerLock;
         public static long roleId;
-        public static string roleName;
+        public static string roleName
+        {
+            get
+            {
+                return GameGlobal.zoneScene.GetComponent<RoleInfosComponent>().GetCurrentRoleName();
+            }
+        }
         public static int rechargeTotalMon
         {
             get
@@ -227,7 +233,6 @@ namespace GFGGame
 
         public static void InitServerData()
         {
-            roleName = GameGlobal.zoneScene.GetComponent<RoleInfosComponent>().GetCurrentRoleName();
             roleId = GameGlobal.zoneScene.GetComponent<RoleInfosComponent>().CurrentRoleId;
         }
         /// <summary>

+ 0 - 1
GameClient/Assets/Game/HotUpdate/ServerProxy/RoleInfoSProxy.cs

@@ -134,7 +134,6 @@ namespace GFGGame
             {
                 if (response.Error == ErrorCode.ERR_Success)
                 {
-                    RoleDataManager.roleName = response.Name;
                     GameGlobal.zoneScene.GetComponent<RoleInfosComponent>().GetCurrentRole().Name = response.Name;
                     EventAgent.DispatchEvent(ConstMessage.CHANGE_ROLE_NAME);
                     return true;