| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 | using FairyGUI;using UnityEngine;using ET;using UI.Common;namespace GFGGame{    public class GameGlobal    {        public static bool isVisitor = false;        public static bool isFirstEntry = false;        //防沉迷开关        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;        public static string gameApiUrl;        public static string gameApiUrlTest;        //ET        public static Scene zoneScene;        public static Unit myUnit;        public static NumericComponent myNumericComponent;        private static UI_ComHolder comHolder;        private static GameObject _gameObj;        private static GoWrapper _wrapper;        public static void Init()        {            loginApiUrl = LauncherConfig.loginApiUrl;            gameApiUrl = loginApiUrl;//外网            gameApiUrlTest = "http://localhost:8081/api/";            CreatClickEffect();        }        public static string version        {            get            {                return Application.version + "." + VEngine.Versions.ManifestsVersion;            }        }        private static void CreatClickEffect()        {            if (comHolder == null)            {                comHolder = UI_ComHolder.Create();                comHolder.target.touchable = false;                ViewManager.AddChildToTopLayer(comHolder.target);                string resPath = ResPathUtil.GetViewEffectPath("ui_dj", "ui_dj");                SceneController.AddObjectToView(_gameObj, _wrapper, comHolder.m_holder, resPath, out _gameObj, out _wrapper);                GRoot.inst.onTouchBegin.Add(SetClickPos);            }        }        private static void SetClickPos()        {            Vector2 pos = GRoot.inst.GlobalToLocal(Stage.inst.touchPosition);            comHolder.m_holder.visible = false;            comHolder.m_holder.visible = true;            comHolder.target.SetPosition(pos.x, pos.y, 0);        }    }}
 |