Example #1
0
    private void GUIWebview()
    {
        float left = 200;

        tex   = GUI.TextField(new Rect(left, 100, 360, 60), tex);
        left += 200;
        if (GUI.Button(new Rect(left + 200, 100, 120, 70), "load"))
        {
            webView.Show(200, 0, 0, 0);
            webView.LoadUrl(tex);
        }
        if (GUI.Button(new Rect(left + 150, 10, 100, 70), "loadhtm"))
        {
            webView.RegistJsInterfaceAction("ShowMsg", ShowMsg);
            webView.Show(160, 0, 0, 0);
            webView.LoadLocal("/litewebview_test.html");
        }
        if (GUI.Button(new Rect(left + 300, 10, 100, 80), "calljs"))
        {
            webView.CallJS("callJS", "https://youku.com/");
        }
        if (GUI.Button(new Rect(left + 450, 10, 100, 80), "close"))
        {
            webView.Close();
        }
    }