コード例 #1
0
 void PopDialog()
 {
     #if UNITY_EDITOR
     INP_Target.text = Test_Input;
     #else
     INP_Target.text = WebNativeDialog.OpenNativeStringDialog(DialogTitle, INP_Target.text);
     #endif
     Debug.Log("Fake BTN Event");
 }
コード例 #2
0
        public static void CopyToClipboard(this string s)
        {
#if UNITY_WEBGL && !UNITY_EDITOR
            WebNativeDialog.SetUpOverlayDialog("Select all text below and copy:", s, "Close");
#else
            GUIStyle style = new GUIStyle();
            style.richText = false;

            TextEditor te = new TextEditor();
            te.style = style;
            te.text  = s;
            te.SelectAll();
            te.Copy();
#endif
        }
コード例 #3
0
    public override void OnSelect(BaseEventData eventData)
    {
        switch (m_DialogType)
        {
        case EDialogType.PromptPopup:
            this.text = WebNativeDialog.OpenNativeStringDialog(m_DialogTitle, this.text);
            StartCoroutine(this.DelayInputDeactive());
            break;

        case EDialogType.OverlayHtml:
            WebNativeDialog.SetUpOverlayDialog(m_DialogTitle, this.text, m_DialogOkBtn, m_DialogCancelBtn);
            StartCoroutine(this.OverlayHtmlCoroutine());
            break;
        }
    }
コード例 #4
0
    private IEnumerator OverlayHtmlCoroutine()
    {
        yield return(new WaitForEndOfFrame());

        this.DeactivateInputField();
        EventSystem.current.SetSelectedGameObject(null);
        WebGLInput.captureAllKeyboardInput = false;
        while (WebNativeDialog.IsOverlayDialogActive())
        {
            yield return(null);
        }
        WebGLInput.captureAllKeyboardInput = true;

        if (!WebNativeDialog.IsOverlayDialogCanceled())
        {
            this.text = WebNativeDialog.GetOverlayDialogValue();
        }
    }