示例#1
0
    void OnGUI()
    {
        GUI.enabled = webViewObject.CanGoBack();
        if (GUI.Button(new Rect(10, 10, 80, 80), "<"))
        {
            webViewObject.GoBack();
        }
        GUI.enabled = true;

        GUI.enabled = webViewObject.CanGoForward();
        if (GUI.Button(new Rect(100, 10, 80, 80), ">"))
        {
            webViewObject.GoForward();
        }
        GUI.enabled = true;

        GUI.TextField(new Rect(200, 10, 300, 80), "" + webViewObject.Progress());

        if (GUI.Button(new Rect(600, 10, 80, 80), "*"))
        {
            var g = GameObject.Find("WebViewObject");
            if (g != null)
            {
                Destroy(g);
            }
            else
            {
                StartCoroutine(Start());
            }
        }
        GUI.enabled = true;
    }
示例#2
0
    void OnGUI()
    {
        var x = 10;

        GUI.enabled = webViewObject.CanGoBack();
        if (GUI.Button(new Rect(x, 10, 80, 80), "<"))
        {
            webViewObject.GoBack();
        }
        GUI.enabled = true;
        x          += 90;

        GUI.enabled = webViewObject.CanGoForward();
        if (GUI.Button(new Rect(x, 10, 80, 80), ">"))
        {
            webViewObject.GoForward();
        }
        GUI.enabled = true;
        x          += 90;

        if (GUI.Button(new Rect(x, 10, 80, 80), "r"))
        {
            webViewObject.Reload();
        }
        x += 90;

        GUI.TextField(new Rect(x, 10, 180, 80), "" + webViewObject.Progress());
        x += 190;

        if (GUI.Button(new Rect(x, 10, 80, 80), "*"))
        {
            var g = GameObject.Find("WebViewObject");
            if (g != null)
            {
                Destroy(g);
            }
            else
            {
                StartCoroutine(Start());
            }
        }
        x += 90;

        if (GUI.Button(new Rect(x, 10, 80, 80), "c"))
        {
            Debug.Log(webViewObject.GetCookies(Url));
        }
        x += 90;

        if (GUI.Button(new Rect(x, 10, 80, 80), "x"))
        {
            webViewObject.ClearCookies();
        }
        x += 90;
    }
示例#3
0
    void OnGUI()
    {
        //GUI.enabled = webViewObject.CanGoBack();
        //if (GUI.Button(new Rect(10, 10, 80, 80), "<"))
        //{
        //    webViewObject.GoBack();
        //}
        //GUI.enabled = true;

        //GUI.enabled = webViewObject.CanGoForward();
        //if (GUI.Button(new Rect(100, 10, 80, 80), ">"))
        //{
        //    webViewObject.GoForward();
        //}
        //GUI.enabled = true;

        //GUI.TextField(new Rect(200, 10, 300, 80), "" + webViewObject.Progress());
        GUI.enabled = webViewObject.CanGoBack();
        if (GUI.Button(new Rect(10, 20, 160, 160), "<"))
        {
            webViewObject.GoBack();
        }
        GUI.enabled = true;

        GUI.enabled = webViewObject.CanGoForward();
        if (GUI.Button(new Rect(200, 20, 160, 160), ">"))
        {
            webViewObject.GoForward();
        }
        GUI.enabled = true;

        GUI.TextField(new Rect(400, 10, 100, 80), "" + webViewObject.Progress());

        if (GUI.Button(new Rect(600, 10, 160, 160), "*"))
        {
            var g = GameObject.Find("WebViewObject");
            if (g != null)
            {
                Destroy(g);
            }
            else
            {
                StartCoroutine(Start());
            }
        }
        GUI.enabled = true;

        //if (GUI.Button(new Rect(700, 10, 80, 80), "c"))
        //{
        //    Debug.Log(webViewObject.GetCookies(Url));
        //}
        //GUI.enabled = true;
    }
 static int QPYX_Progress_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 1);
         WebViewObject QPYX_obj_YXQP = (WebViewObject)ToLua.CheckObject <WebViewObject>(L_YXQP, 1);
         int           QPYX_o_YXQP   = QPYX_obj_YXQP.Progress();
         LuaDLL.lua_pushinteger(L_YXQP, QPYX_o_YXQP);
         return(1);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
示例#5
0
    void OnGUI()
    {
        GUI.enabled = webViewObject.CanGoBack();
        if (GUI.Button(new Rect(10, 10, 80, 80), "<"))
        {
            webViewObject.GoBack();
        }
        GUI.enabled = true;

        GUI.enabled = webViewObject.CanGoForward();
        if (GUI.Button(new Rect(100, 10, 80, 80), ">"))
        {
            webViewObject.GoForward();
        }
        GUI.enabled = true;

        GUI.TextField(new Rect(200, 10, 300, 80), "" + webViewObject.Progress());
    }
示例#6
0
    // Check internet connection every 1 second and try to open mUrl
    // If loading domain != current domain and it not local then open it in standart browser
    // And waiting for key "back" to load previous page
    void Update()
    {
        UpdateCount++;

        webViewObject.EvaluateJS("if (location) { window.Unity.call('url:' + location.href); }");

        timer += Time.deltaTime;

        if (timer > waitTime)
        {
            timerCount++;
            if (Application.internetReachability == NetworkReachability.NotReachable)
            {
                connStatus = "-2";
                LoadLocalPage();
            }
            else
            {
                connStatus = "NoErrors";
                devStatus  = "CONNECTION SUCCESSFUL";

                if (notInnerUrl(mUrl))
                {
                    openUrl   = mUrl;
                    devStatus = "LOADING EXTERNAL URL";
                    webViewObject.GoBack();
                }

                if ((webViewObject.Progress() == 100) & (openUrl != ""))
                {
                    LoadExternalPage(openUrl.Substring(4));
                    connStatus = "LoadingEXT";
                }
            }
            timer = 0f;
        }

        // cf. https://github.com/trylogin START
        if ((Input.GetKeyDown(KeyCode.Escape)) & (webViewObject.CanGoBack()))
        {
            webViewObject.GoBack();
        }
        // cf. https://github.com/trylogin START
    }