GameConfig.cs 992 B

1234567891011121314151617181920212223242526272829303132333435
  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. public static void InitData(string json)
  14. {
  15. ET.Log.Debug($"gamecfg \n{json}");
  16. var result = JsonMapper.ToObject<Result>(json);
  17. LoginAddress = result.loginApiUrl;
  18. // LoginAddress = "http://login.gfg.com:10005";
  19. //LoginAddress = "127.0.0.1:10005";//测试地址
  20. PlatformName = result.platformName;
  21. showGM = int.Parse(result.showGM);
  22. GameConfig.logApiReportUrl = LauncherConfig.logApiRootUrl + "ReportGet";
  23. }
  24. private struct Result
  25. {
  26. public string loginApiUrl;
  27. public string platformName;
  28. public string showGM;
  29. }
  30. }
  31. }