コード例 #1
0
    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();
    }
コード例 #2
0
    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
    }