123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- using UnityEngine;
- using ET;
- using LitJson;
- namespace GFGGame
- {
- public class GameGlobal
- {
- public static bool isVisitor = false;
- public static bool isFirstEntry = false;
- public static string cfgName;
- //防沉迷开关
- public static bool antiAddiction = true;
- public static long userId = 0;
- public static int userAge = 0;
- public static bool skipGuide;
- public static bool skipCheckOpen;//跳过功能开启检查
- public static bool isEnterGame = false;
- public static string loginApiUrl;
- //ET
- public static Scene zoneScene;
- public static Unit myUnit;
- public static NumericComponent myNumericComponent;
-
- //平台
- public static int platformId = 1;
- public static void Init()
- {
- cfgName = LauncherConfig.cfgName + "_in";
- }
- public static string version
- {
- get
- {
- return Application.version + "." + VEngine.Versions.ManifestsVersion;
- }
- }
- /// <summary>
- /// 获取游戏配置
- /// </summary>
- public static void GetGameCfg()
- {
- var url = LauncherConfig.cfgUrl.Replace("{cfgName}", cfgName);
- HttpTool.Instance.Get(url, (string data) => {
- ResultHandler(data);
- });
- }
- private static void ResultHandler(string data)
- {
- var result = JsonMapper.ToObject<Result>(data);
- loginApiUrl = result.loginApiUrl;
- ConstValue.LoginAddress = loginApiUrl;
- //开始游戏
- GameController.Start().Coroutine();
- }
- private struct Result
- {
- public string loginApiUrl;
- }
- }
- }
|