Parcourir la source

添加兑换码开关

guodong il y a 1 an
Parent
commit
01f977bf4d

+ 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()