예제 #1
0
    public void OpenRauderWeb()
    {
#if UNITY_IPHONE
        //InitPosition(iPhoneSettings.generation);
        InitPositionByScale();
        WebMediator.LoadUrl(url);
        WebMediator.SetMargin(left, top, right, bottom);
        WebMediator.Show();
#elif  UNITY_ANDROID
        if (isActivityWebview)
        {
            InitPosition();
            WebMediator.LoadUrl(url);
            WebMediator.SetMargin(left, top, right, bottom);
            WebMediator.Show();
        }
        else
        {
            WebMediator.ShowWebView(url);
        }
#endif
#if UNITY_IPHONE
        DefaultPanel.SetActive(false);
        NoticePanel.SetActive(false);
        RaiderPanel.SetActive(true);
#elif UNITY_ANDROID
        DefaultPanel.SetActive(false);
        NoticePanel.SetActive(false);
        RaiderPanel.SetActive(false);
#endif
        //Debug.Log("Enter OpenWeb!");
        //Debug.Log("In OpenWeb : url="+url);
        //Debug.Log("In OpenWeb : top="+top+" ; bottom="+bottom+" ; left="+left+" ; right="+right);
    }
예제 #2
0
    public static void PreWebView(string url)
    {
#if UNITY_EDITOR
#else
        WebMediator.LoadUrl(url);
        WebMediator.Hide();
#endif
    }
예제 #3
0
    public void OpenPublicNoticeWeb()
    {
/*
 *      WebViewHeightType hType = WebViewHeightType.HEIGHT_1136;
 #if UNITY_IPHONE
 *      hType = GetCurrentHeightTyp(iPhoneSettings.generation);
 #elif  UNITY_ANDROID
 *              //hType = GetCurrentHeightTyp();
 #endif
 *      Rect rt = GetWebViewRect(hType, WebViewType.NOTICE);
 #if UNITY_IPHONE
 *      WebMediator.LoadUrl(url);
 *      WebMediator.SetMargin((int)rt.xMin, (int)rt.yMin, (int)rt.width, (int)rt.height);
 *          WebMediator.Show();
 #elif  UNITY_ANDROID
 *              if(isActivityWebview)
 *              {
 *                      WebMediator.LoadUrl(url);
 *          WebMediator.SetMargin((int)rt.xMin, (int)rt.yMin, (int)rt.width, (int)rt.height);
 *              WebMediator.Show();
 *              }
 *              else
 *              {
 *                      WebMediator.ShowWebView(url);
 *              }
 #endif
 */
#if UNITY_IPHONE
        //InitPosition(iPhoneSettings.generation);
        InitPositionByScale();
        WebMediator.LoadUrl(url);
        WebMediator.SetMargin(left, top, right, bottom);
        WebMediator.Show();
#elif  UNITY_ANDROID
        if (isActivityWebview)
        {
            InitPosition();
            WebMediator.LoadUrl(url);
            WebMediator.SetMargin(left, top, right, bottom);
            WebMediator.Show();
        }
        else
        {
            WebMediator.ShowWebView(url);
        }
#endif

#if UNITY_IPHONE
        NoticePanel.SetActive(true);
        DefaultPanel.SetActive(false);
        RaiderPanel.SetActive(false);
#elif UNITY_ANDROID
        DefaultPanel.SetActive(false);
        NoticePanel.SetActive(false);
        RaiderPanel.SetActive(false);
#endif
    }
예제 #4
0
 public void ActivateWebView()
 {
     Klikajka = true;
     aaa      = true;
     Int32.TryParse(EventSystem.current.currentSelectedGameObject.name, out organizations);
     WebMediator.LoadUrl(Link[organizations]);
     WebMediator.SetMargin(12, Screen.height / 8 + 12, 12, 12);
     WebMediator.Show();
 }
예제 #5
0
    void OnDisable()
    {
#if UNITY_IPHONE
        WebMediator.Hide();
        // Clear the state of the web view (by loading a blank page).
        WebMediator.LoadUrl("about:blank");
#elif UNITY_ANDROID
        if (isActivityWebview)
        {
            WebMediator.Hide();
            WebMediator.LoadUrl("about:blank");
        }
        else
        {
            WebMediator.HideWebView();
        }
#endif
    }
예제 #6
0
    public void OpenDefaultWeb()
    {
        left = 0;       right = 0;      bottom = 0;
#if UNITY_IPHONE
        if (Screen.height > 1136)
        {
            top = 132;
        }
        else
        {
            top = 66;
        }

        WebMediator.LoadUrl(url);
        WebMediator.SetMargin(left, top, right, bottom);
        WebMediator.Show();
#elif  UNITY_ANDROID
        if (isActivityWebview)
        {
            top = 66;
            WebMediator.LoadUrl(url);
            WebMediator.SetMargin(left, top, right, bottom);
            WebMediator.Show();
        }
        else
        {
            WebMediator.ShowWebView(url);
        }
#endif
#if UNITY_IPHONE
        DefaultPanel.SetActive(true);
        NoticePanel.SetActive(false);
        RaiderPanel.SetActive(false);
#elif UNITY_ANDROID
        DefaultPanel.SetActive(false);
        NoticePanel.SetActive(false);
        RaiderPanel.SetActive(false);
#endif
    }
예제 #7
0
    public static void ShowWebView(string url, webViewMode mode)
    {
#if UNITY_EDITOR
#else
        WebMediator.LoadUrl("about:blank");
        Debug.Log("Enter ShowWebView!");
        removeWebView();

        topFrame = ResourceManager.Instance.LoadPopUp("WebViewBox");        //(GameObject)GameObject.Instantiate(messageBox);
        topFrame.transform.parent        = Camera.mainCamera.transform;
        topFrame.transform.localScale    = Vector3.one;
        topFrame.transform.localPosition = new Vector3(0, 0, box_z);

        WebViewBox wvb = topFrame.GetComponent <WebViewBox>();
        Debug.Log("ShowWebView url = " + url);

        if (wvb)
        {
            switch (mode)
            {
            case webViewMode.MESSAGEBOX:
                wvb.OpenWebWinow(WebViewBox.WebViewType.DEFAULT, url);
                break;

            case webViewMode.RAIDER:
                wvb.OpenWebWinow(WebViewBox.WebViewType.RAIDER, url);
                break;

            case webViewMode.NOTICE:
                wvb.OpenWebWinow(WebViewBox.WebViewType.NOTICE, url);
                break;
            }
        }
        else
        {
            Debug.Log("WebViewBox is NULL!!!");
        }
#endif
    }
예제 #8
0
 // Hide the web view.
 private void DeactivateWebView()
 {
     WebMediator.Hide();
     // Clear the state of the web view (by loading a blank page).
     WebMediator.LoadUrl("about:blank");
 }
예제 #9
0
 // Show the web view (with margins) and load the index page.
 private void ActivateWebView()
 {
     WebMediator.LoadUrl("http://keijiro.github.com/unity-webview-integration/index.html");
     WebMediator.SetMargin(12, Screen.height / 2 + 12, 12, 12);
     WebMediator.Show();
 }
예제 #10
0
 private void DeactivateWebView()
 {
     WebMediator.Hide();
     WebMediator.LoadUrl("about:blank");
 }