private void OnGUI() { var setting = HookLuaSetup.setting; if (GUI.Button(new Rect(0, 0, 200, 100), "Connect")) { LPNetWorkClient.ConnectServer(setting.ip, setting.port); } setting.ip = GUI.TextField(new Rect(210, 20, 200, 60), setting.ip); if (GUI.Button(new Rect(0, 110, 200, 100), "Disconnect")) { LPNetWorkClient.Close(); } if (setting.discardInvalid) { if (GUI.Button(new Rect(0, 220, 200, 100), "ShowAll")) { setting.discardInvalid = false; } } else { if (GUI.Button(new Rect(0, 220, 200, 100), "HideUseless")) { setting.discardInvalid = true; } } }
public static void OnStartGame() { #if UNITY_EDITOR if (!Application.isPlaying) { return; } #endif if (isInite) { return; } isInite = true; setting = LuaDeepProfilerSetting.Instance; LPLuaProfiler.mainThreadId = System.Threading.Thread.CurrentThread.ManagedThreadId; if (setting.isNeedCapture) { Screen.SetResolution(480, 270, true); } #if UNITY_EDITOR if (setting.isDeepLuaProfiler) { LuaDLL.Uninstall(); LuaDLL.HookLoadLibrary(); LuaDLL.BindEasyHook(); //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>(); if (!setting.isLocal) { LPNetWorkClient.ConnectServer(setting.ip, setting.port); } } }