GameConfig.cs 979 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System.Collections;
  2. using ET;
  3. using LitJson;
  4. using UnityEngine;
  5. namespace GFGGame
  6. {
  7. public class GameConfig
  8. {
  9. public static string LoginAddress;
  10. public static string PlatformName;
  11. public static string logApiReportUrl;
  12. public static int showGM;
  13. //渠道id
  14. public static int ChannelId = 1;
  15. public static void InitData(string json)
  16. {
  17. ET.Log.Debug($"gamecfg \n{json}");
  18. var result = JsonMapper.ToObject<Result>(json);
  19. LoginAddress = result.loginApiUrl;
  20. //LoginAddress = "10.108.64.127:10005";
  21. PlatformName = result.platformName;
  22. showGM = int.Parse(result.showGM);
  23. GameConfig.logApiReportUrl = LauncherConfig.logApiRootUrl + "Report";
  24. }
  25. private struct Result
  26. {
  27. public string loginApiUrl;
  28. public string platformName;
  29. public string showGM;
  30. }
  31. }
  32. }