コード例 #1
0
        public static void OnStartGame()
        {
#if UNITY_EDITOR
            if (!Application.isPlaying)
            {
                return;
            }
#endif
            if (isInite)
            {
                return;
            }

            isInite = true;
            setting = LuaDeepProfilerSetting.MakeInstance();
            LuaProfiler.mainThreadId = System.Threading.Thread.CurrentThread.ManagedThreadId;
            if (setting.isNeedCapture)
            {
                Screen.SetResolution(480, 270, true);
            }

#if UNITY_EDITOR
            if (setting.isDeepLuaProfiler)
            {
                LuaDLL.UnInstall();
                LuaDLL.Install();
            }
#endif

            if (setting.isDeepLuaProfiler || setting.isDeepMonoProfiler || setting.isCleanMode)
            {
                GameObject go = new GameObject();
                go.name      = "MikuLuaProfiler";
                go.hideFlags = HideFlags.HideAndDontSave;
                DontDestroyOnLoad(go);
                go.AddComponent <HookLuaSetup>();
                NetWorkClient.ConnectServer(setting.ip, setting.port);
            }
        }