Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        if (teacherbrowser == null)
        {
            return;
        }
        Browser teacherScript = teacherbrowser.GetComponent <Browser>();
        Browser mainScript    = GetComponent <Browser>();

        teacherUrl = teacherScript.Url;
        mainUrl    = mainScript.Url;
    }
        protected void ObserveBrowser(Browser browser)
        {
            if (browser == keyboardBrowser)
            {
                return;                                //don't want to know about ourself
            }
            browser.onNodeFocus += (tagName, editable, value) => {
                if (!this)
                {
                    return;
                }
                if (browser != ActiveBrowser && !browser.focusState.hasMouseFocus)
                {
                    return;
                }

                DoFocus(browser);
            };

            var pointerUI = browser.GetComponent <PointerUIBase>();

            if (pointerUI)
            {
                pointerUI.onClick += () => {
                    DoFocus(browser);
                };
            }
        }
        protected void _SetActiveBrowser(Browser browser)
        {
            if (ActiveBrowser)
            {
                if (activeBrowserUI && forcingFocus)
                {
                    activeBrowserUI.ForceKeyboardHasFocus(false);
                    forcingFocus = false;
                }
            }

            _activeBrowser  = browser;
            activeBrowserUI = ActiveBrowser.GetComponent <PointerUIBase>();
            if (!activeBrowserUI)
            {
                //We can't focus the browser when we type, so the typed letters won't appear as we type.
                Debug.LogWarning("Browser does not have a PointerUI, external keyboard may not work properly.");
            }
        }
Beispiel #4
0
        protected void ObserveBrowser(Browser browser)
        {
            browser.onNodeFocus += (tagName, editable, value) => {
                if (!this)
                {
                    return;
                }
                if (!browser.focusState.hasMouseFocus)
                {
                    return;
                }

                DoFocus(browser);
            };

            var pointerUI = browser.GetComponent <PointerUIBase>();

            if (pointerUI)
            {
                pointerUI.onClick += () => {
                    DoFocus(browser);
                };
            }
        }