public void ConfigureEditor(string configScript) { if (editorID >= 0) { WebGLAce.ConfigureEditor(editorID, configScript); } }
public void SetEditorText(string text) { if (editorID >= 0) { WebGLAce.SetEditorText(editorID, text); } }
public void OnDestroy() { Debug.Log("WebGLAce_TMP_InputField: OnDestroy", this); if (editorID >= 0) { WebGLAce.DestroyEditor(editorID); editorID = -1; } }
public string GetEditorText() { if (editorID >= 0) { return(WebGLAce.GetEditorText(editorID)); } else { return(this.text); } }
public void OnRectTransformDimensionsChange() { Debug.Log("WebGLAce_TMP_InputField: OnRectTransformDimensionsChange", this); if (editorID >= 0) { int x, y, width, height; GetScreenRect(out x, out y, out width, out height); WebGLAce.ResizeEditor(editorID, x, y, width, height); } }
public void UpdateEditor() { if (editorID < 0) { return; } WebGLAce.SetEditorReadOnly(editorID, !this.interactable); WebGLAce.SetEditorFocused(editorID, this.interactable && this.enabled); #if UNITY_WEBGL && !UNITY_EDITOR WebGLInput.captureAllKeyboardInput = !(this.interactable && this.enabled); #endif Debug.Log("WebGLAce_TMP_InputField: UpdateEditor: readOnly " + (!this.interactable) + " focused: " + (this.interactable && this.enabled) + " capture: " + !(this.interactable && this.enabled)); }
public void ShowEditor() { if (editorID < 0) { int x, y, width, height; GetScreenRect(out x, out y, out width, out height); //Debug.Log("WebGLAce_TMP_InputField: ShowEditor: screenRect " + x + " " + y + " " + width + " " + height); editorID = WebGLAce.CreateEditor(x, y, width, height, this.text, this.editorConfigScript); } else { WebGLAce.SetEditorText(editorID, this.text); } WebGLAce.SetEditorVisible(editorID, true); UpdateEditor(); }
public void HideEditor() { if (editorID < 0) { return; } if (this.interactable) { string text = WebGLAce.GetEditorText(editorID); #if UNITY_WEBGL && !UNITY_EDITOR Debug.Log("WebGLAce_TMP_InputField: HideEditor: text: " + text); this.text = text; #endif } WebGLAce.SetEditorVisible(editorID, false); WebGLAce.SetEditorFocused(editorID, false); #if UNITY_WEBGL && !UNITY_EDITOR WebGLInput.captureAllKeyboardInput = true; #endif }