public void Dispose() { server.Stop(); const string template = "window.socket{0}.close(); window.socket{0} = undefined"; if (webView) { webView.LocationChanged -= UpdateDefinitions; webView.ExecuteJavascript(string.Format(template, port)); } }
void OnGUI() { // hook to this window if (webView.Hook(this)) { // do the first thing to do webView.LoadHTML(Compose()); } var half = new Rect(0, 0, position.width / 2, position.height); // html text field EditorGUI.BeginChangeCheck(); data = EditorGUI.TextArea(half, data); if (EditorGUI.EndChangeCheck()) { // push changes to webView and notify our input hook.Update(); webView.ExecuteJavascript("update()"); } half.x += half.width; if (Event.current.type == EventType.Repaint) { // keep the browser aware with resize webView.OnGUI(half); } else if (half.Contains(Event.current.mousePosition)) { GUIUtility.keyboardControl = 0; } }