コード例 #1
0
 public void ConfigureEditor(string configScript)
 {
     if (editorID >= 0)
     {
         WebGLAce.ConfigureEditor(editorID, configScript);
     }
 }
コード例 #2
0
 public void SetEditorText(string text)
 {
     if (editorID >= 0)
     {
         WebGLAce.SetEditorText(editorID, text);
     }
 }
コード例 #3
0
    public void OnDestroy()
    {
        Debug.Log("WebGLAce_TMP_InputField: OnDestroy", this);

        if (editorID >= 0)
        {
            WebGLAce.DestroyEditor(editorID);
            editorID = -1;
        }
    }
コード例 #4
0
 public string GetEditorText()
 {
     if (editorID >= 0)
     {
         return(WebGLAce.GetEditorText(editorID));
     }
     else
     {
         return(this.text);
     }
 }
コード例 #5
0
    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);
        }
    }
コード例 #6
0
    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));
    }
コード例 #7
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();
    }
コード例 #8
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
    }