GameConfig.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 SOUND_KEY = "sound";
  10. public static string MUSIC_KEY = "music";
  11. public static string VOICE_KEY = "voice";
  12. public static string SOUND_VOLUMN_KEY = "sound_volumn";
  13. public static string MUSIC_VOLUMN_KEY = "music_volumn";
  14. public static string VOICE_VOLUMN_KEY = "voice_volumn";
  15. public static string LoginAddress;
  16. public static string PlatformName;
  17. public static string logApiReportUrl;
  18. public static int showGM;
  19. //开服时间
  20. public static long openTime = 0;
  21. public static void InitData(string json)
  22. {
  23. ET.Log.Debug($"gamecfg \n{json}");
  24. var result = JsonMapper.ToObject<Result>(json);
  25. LoginAddress = result.loginApiUrl;
  26. // LoginAddress = "http://login.gfg.com:10005";
  27. //LoginAddress = "127.0.0.1:10005";//测试地址
  28. PlatformName = result.platformName;
  29. showGM = int.Parse(result.showGM);
  30. if(!string.IsNullOrEmpty(result.openTime))
  31. {
  32. openTime = TimeUtil.GetTimestamp(result.openTime);
  33. }
  34. GameConfig.logApiReportUrl = LauncherConfig.logApiRootUrl + "ReportGet";
  35. }
  36. private struct Result
  37. {
  38. public string loginApiUrl;
  39. public string platformName;
  40. public string showGM;
  41. public string openTime;
  42. }
  43. }
  44. }