private void Awake() { mInstance = this; #if UNITY_EDITOR if (ConfigurationDefine.OpenAssetBundle) { StartCoroutine(LoadLuaFile()); } else { LuaMain(); //ClientSocket.ConnectServer(); } #endif }
static void Initialize() { if (!_globalGameObject) { _globalGameObject = new GameObject("GlobalGameObject"); #if UNITY_EDITOR if (Application.isPlaying) #endif GameObject.DontDestroyOnLoad(_globalGameObject); _globalGameObject.hideFlags = HideFlags.HideInHierarchy | HideFlags.HideInInspector | HideFlags.DontSaveInEditor | HideFlags.DontSaveInBuild | HideFlags.DontUnloadUnusedAsset; _globalComponent = _globalGameObject.AddComponent<GlobalComponent>(); } }