public static void OnStartGame() { #if UNITY_EDITOR if (!Application.isPlaying) { return; } #endif #if UNITY_EDITOR_WIN string path = null; var files = System.IO.Directory.GetFiles(Application.dataPath, "EasyHook64.bin", System.IO.SearchOption.AllDirectories); if (files.Length > 0) { path = files[0]; } if (!string.IsNullOrEmpty(path)) { IntPtr ptr = LoadLibrary(path); if (ptr == IntPtr.Zero) { Debug.LogError("dont't move dll file to other place"); return; } } else { Debug.LogError("no EasyHook64.bin"); return; } #endif if (isInite) { return; } isInite = true; setting = LuaDeepProfilerSetting.Instance; LuaProfiler.mainThreadId = System.Threading.Thread.CurrentThread.ManagedThreadId; if (setting.isNeedCapture) { Screen.SetResolution(480, 270, true); } #if UNITY_EDITOR if (setting.isDeepLuaProfiler) { LuaDLL.UnbindCsLuaProfiler(); LuaDLL.Instance.Uninstall(); LuaDLL.Instance.HookLoadLibrary(); LuaDLL.Instance.BindEasyHook(); LuaDLL.BindCsLuaProfiler(); //LuaDLL.Install(); if (setting.isCleanMode) { LuaProfilerPrecompileSetting.CompileLuaScript(false); } } #endif if (setting.isDeepLuaProfiler || setting.isDeepMonoProfiler || setting.isCleanMode) { GameObject go = new GameObject(); go.name = "MikuLuaProfiler"; go.hideFlags = HideFlags.HideAndDontSave; DontDestroyOnLoad(go); go.AddComponent <HookLuaSetup>(); if (!setting.isLocal) { NetWorkClient.ConnectServer(setting.ip, setting.port); } } }