private void OnGUI() { var setting = HookLuaSetup.setting; if (GUI.Button(new Rect(0, 0, 200, 100), "Connect")) { NetWorkClient.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")) { NetWorkClient.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.MakeInstance(); LuaProfiler.mainThreadId = System.Threading.Thread.CurrentThread.ManagedThreadId; if (setting.isNeedCapture) { Screen.SetResolution(480, 270, true); } 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); } }
public void Run( RemoteHooking.IContext context, string channelName , HookParameter parameter ) { frameCount = 0; try { LuaDLL.Uninstall(); LuaDLL.HookLoadLibrary(); LuaDLL.BindEasyHook(); MessageBox.Show("success"); } catch (Exception ex) { MessageBox.Show(ex.Message); return; } NetWorkClient.ConnectServer("127.0.0.1", 2333); while (true) { Thread.Sleep(100); frameCount++; } }
public static void OnStartGame() { setting = LuaDeepProfilerSetting.MakeInstance(); LuaProfiler.mainThreadId = System.Threading.Thread.CurrentThread.ManagedThreadId; if (setting.isNeedCapture) { Screen.SetResolution(480, 270, true); } if (setting.isDeepLuaProfiler || setting.isDeepMonoProfiler) { GameObject go = new GameObject(); go.name = "MikuLuaProfiler"; go.hideFlags = HideFlags.HideAndDontSave; go.AddComponent <HookLuaSetup>(); NetWorkClient.ConnectServer(setting.ip, setting.port); } }
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 == null) { 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.Uninstall(); LuaDLL.HookLoadLibrary(); LuaDLL.BindEasyHook(); //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); } } }
public static void OnStartGame() { #if UNITY_EDITOR if (!Application.isPlaying) { return; } #endif #if UNITY_EDITOR_WIN System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace(true); System.Diagnostics.StackFrame sf = st.GetFrame(0); string path = sf.GetFileName(); path = path.Replace("Core\\LuaHookSetup.cs", "Plugins\\EasyHook64.dll"); IntPtr ptr = LoadLibrary(path); if (ptr == null) { Debug.LogError("dont't move dll file to other place"); 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.Uninstall(); LuaDLL.HookLoadLibrary(); LuaDLL.BindEasyHook(); //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); } } }