Beispiel #1
0
    public static void ShowWebView(string url, webViewMode mode, WebMediator.CallBackCloseWebview OnCloseWebView)
    {
#if UNITY_EDITOR
#else
        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)
        {
            WebMediator.SetOnCallBackCloseWebView(OnCloseWebView);
            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
    }