public static void Shutdown() { if (_instance != null) { _instance.Stop(); _instance = null; } }
public static DuktapeDebugger CreateDebugger(IntPtr ctx, int port, int bufferSize) { if (_instance != null) { throw new Exception("debugger already exists"); } _buffer = new byte[bufferSize]; _instance = new DuktapeDebugger(); _instance._ctx = ctx; _instance._debugger = IntPtr.Zero; _instance.Start(port); return(_instance); }
public static DuktapeDebugger CreateDebugger(DuktapeVM vm, int port, int bufferSize) { if (_instance != null) { throw new Exception("debugger already exists"); } if (!Application.isPlaying) { throw new Exception(); } var gameObject = new GameObject("_duktape_debugger"); _instance = gameObject.AddComponent <DuktapeDebugger>(); _buffer = new byte[bufferSize]; _instance._vm = vm; _instance.Serve(port); return(_instance); }
public void OnLoaded(DuktapeVM vm) { _vm.AddSearchPath(scriptRootPath); if (debuggerSupport) { DuktapeDebugger.CreateDebugger(_vm); if (waitForDebuggerAttack) { Debug.LogWarning("waiting for debugger attach"); DuktapeDebugger.onAttached += () => { _vm.EvalMain(entryScript); }; } } else { _vm.EvalMain(entryScript); } }