소스 검색

添加兑换码开关

guodong 1 년 전
부모
커밋
01f977bf4d
2개의 변경된 파일9개의 추가작업 그리고 4개의 파일을 삭제
  1. 8 4
      GameClient/Assets/Game/HotUpdate/GameConfig.cs
  2. 1 0
      GameClient/Assets/Game/HotUpdate/Views/RoleInfo/SettingView.cs

+ 8 - 4
GameClient/Assets/Game/HotUpdate/GameConfig.cs

@@ -1,7 +1,4 @@
-using System.Collections;
-using ET;
-using LitJson;
-using UnityEngine;
+using LitJson;
 
 namespace GFGGame
 {
@@ -24,6 +21,8 @@ namespace GFGGame
         public static long openTime = 0;
         public static int tsStatus;
         public static int tsServer;
+        //兑换码
+        public static int code;
 
         public static void InitData(string json)
         {
@@ -45,6 +44,10 @@ namespace GFGGame
             {
                 tsServer = int.Parse(result.tsServer);
             }
+            if(!string.IsNullOrEmpty(result.code))
+            {
+                code = int.Parse(result.code);
+            }
             GameConfig.logApiReportUrl = LauncherConfig.logApiRootUrl + "ReportGet";
         }
 
@@ -55,6 +58,7 @@ namespace GFGGame
             public string openTime;
             public string tsStatus;
             public string tsServer;
+            public string code;
         }
     }
 }

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Views/RoleInfo/SettingView.cs

@@ -74,6 +74,7 @@ namespace GFGGame
                 _ui.m_suit.Play();
                 _ui.m_c1.SetSelectedIndex(0);
             }
+            _ui.m_btnGiftCode.target.visible = GameConfig.code == 0;
         }
 
         protected override void OnHide()