Ejemplo n.º 1
0
        protected void Start()
        {
            panelBrowser = GetComponent <Browser>();
            panelBrowser.RegisterFunction("go", args => {
                DemoNav(args[0].Check());
            });

            demoBrowser.onLoad += info => {
                panelBrowser.CallFunction("setDisplayedUrl", demoBrowser.Url);
            };

            demoBrowser.Url = demoSites[0];
        }
Ejemplo n.º 2
0
        public void Start()
        {
            HUDBrowser = hud.GetComponent <Browser>();
            HUDBrowser.RegisterFunction("unpause", args => Unpause());
            HUDBrowser.RegisterFunction("quit", args => Application.Quit());

            Unpause();

                #if UNITY_STANDALONE_LINUX
            StartCoroutine(Rehide());
                #endif

            //Update coin count on hud when user gets one
            PlayerInventory.Instance.coinCollected += count => HUDBrowser.CallFunction("setCoinCount", count);
        }
Ejemplo n.º 3
0
        public void HandleDialog(BrowserNative.DialogType type, string text, string promptDefault = null)
        {
            if (type == BrowserNative.DialogType.DLT_HIDE)
            {
                Hide();
                return;
            }

            Show();

//		Debug.Log("HandleDialog " + type + " text " + text);

            switch (type)
            {
            case BrowserNative.DialogType.DLT_ALERT:
                dialogBrowser.CallFunction("showAlert", text);
                break;

            case BrowserNative.DialogType.DLT_CONFIRM:
                dialogBrowser.CallFunction("showConfirm", text);
                break;

            case BrowserNative.DialogType.DLT_PROMPT:
                dialogBrowser.CallFunction("showPrompt", text, promptDefault);
                break;

            case BrowserNative.DialogType.DLT_PAGE_UNLOAD:
                dialogBrowser.CallFunction("showConfirmNav", text);
                break;

            case BrowserNative.DialogType.DLT_PAGE_RELOAD:
                dialogBrowser.CallFunction("showConfirmReload", text);
                break;

            case BrowserNative.DialogType.DLT_GET_AUTH:
                dialogBrowser.CallFunction("showAuthPrompt", text);
                break;

            default:
                throw new ArgumentOutOfRangeException("type", type, null);
            }
        }
Ejemplo n.º 4
0
        /** Changes the color of the box on the page by calling a function in the page. */
        public void ChangeColor()
        {
            var color = colors[colorIdx++ % colors.Length];

            browser.CallFunction("changeColor", color.r, color.g, color.b, "Selection Number " + colorIdx).Done();
        }
Ejemplo n.º 5
0
 public void SetCode(string liveCode)
 {
     browser.CallFunction("setCode", liveCode);
 }