GameConfig.cs 791 B

1234567891011121314151617181920212223242526272829303132
  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 int showGM;
  12. public static void InitData(string json)
  13. {
  14. ET.Log.Debug($"gamecfg \n{json}");
  15. var result = JsonMapper.ToObject<Result>(json);
  16. LoginAddress = result.loginApiUrl;
  17. //LoginAddress = "10.108.64.127:10005";
  18. PlatformName = result.platformName;
  19. showGM = int.Parse(result.showGM);
  20. }
  21. private struct Result
  22. {
  23. public string loginApiUrl;
  24. public string platformName;
  25. public string showGM;
  26. }
  27. }
  28. }