Beispiel #1
0
    /// <summary>
    /// Awake this instance.
    /// </summary>
    void Awake()
    {
        _webView = gameObject.AddComponent <UniWebView> ();

        //TODO: 予めロードしているデータのデータが存在しない場合は通信してサーバーから再取得する必要がある
        //UserDeviceEntity.UserDevice uDevice = Extention.CommonPlayerPrefs.CommonLoad<UserDeviceEntity.UserDevice> (ApiConstants.API_USER_DEVICE);

        _webView.CleanCache();
        _webView.SetShowSpinnerWhenLoading(true);
        _webView.backButtonEnable         = true;
        _webView.autoShowWhenLoadComplete = true;

        // 設定サイズを取得
        //WebviewLayout.InsetsParameter wInsets = WebviewLayout.GetInsetsWebview (0.1785f, 0.0f, 0.097f);
        WebviewLayout.InsetsParameter wInsets = WebviewLayout.GetInsetsWebview(0.13f, 0.0f, 0.2f);
        _webView.insets = new UniWebViewEdgeInsets(wInsets.top, wInsets.side, wInsets.bottom, wInsets.side);

        _webView.SetShowSpinnerWhenLoading(true);
        _webView.SetTransparentBackground(true);
    }
    /// <summary>
    /// Gps Map the webview load.
    /// Map用のWEBViewデータを取得する
    /// </summary>
    public void Init()
    {
        _loadingOverlay.SetActive(true);
        LoadingTimer.Instance.IsTimerStop(true);
        _webView = this.gameObject.AddComponent <UniWebView> ();
        _webView.backButtonEnable         = false;
        _webView.autoShowWhenLoadComplete = true;

        // 設定サイズを取得
        WebviewLayout.InsetsParameter wInsets = WebviewLayout.GetInsetsWebview(0.19f, 0.0f, 0.2f);
        _webView.insets = new UniWebViewEdgeInsets(wInsets.top, wInsets.side, wInsets.bottom, wInsets.side);
        _webView.SetTransparentBackground(true);
        _webView.AddUrlScheme("chat");

        string url         = DomainData.GetWebviewDataURL(DomainData.WEBVIEW_INTRODUCTION);
        string querystring = "";

        querystring = "?user_key=" + AppStartLoadBalanceManager._userKey;

        _webView.url = url += querystring;
        _webView.Load();
        _webView.OnLoadComplete    += OnLoadComplete;
        _webView.OnReceivedMessage += OnReceivedMessage;
    }
    /// <summary>
    /// Creates the web view.
    /// </summary>
    /// <returns>The web view.</returns>
    public void Init()
    {
        _loadingOverlay.SetActive(true);

        LoadingTimer.Instance.IsTimerStop(true);

        this.gameObject.AddComponent <UniWebView> ();
        _webView = this.gameObject.GetComponent <UniWebView> ();

        string url = DomainData.GetWebviewDataURL(DomainData.WEBVIEW_MAP) + AppStartLoadBalanceManager._userKey;

        // 条件しばり追加
        string querystring = "";

        if (EventManager.SearchEventManager.Instance._lat != "")
        {
            querystring += "&lat=" + EventManager.SearchEventManager.Instance._lat;
        }
        if (EventManager.SearchEventManager.Instance._lng != "")
        {
            querystring += "&lng=" + EventManager.SearchEventManager.Instance._lng;
        }
        if (EventManager.SearchEventManager.Instance._sex != "")
        {
            querystring += "&sex_cd=" + EventManager.SearchEventManager.Instance._sex;
        }
        if (EventManager.SearchEventManager.Instance._ageFrom != "")
        {
            querystring += "&age_from=" + EventManager.SearchEventManager.Instance._ageFrom;
        }
        if (EventManager.SearchEventManager.Instance._ageTo != "")
        {
            querystring += "&age_to=" + EventManager.SearchEventManager.Instance._ageTo;
        }
        if (EventManager.SearchEventManager.Instance._heightFrom != "")
        {
            querystring += "&height_from=" + EventManager.SearchEventManager.Instance._heightFrom;
        }
        if (EventManager.SearchEventManager.Instance._heightTo != "")
        {
            querystring += "&height_to=" + EventManager.SearchEventManager.Instance._heightTo;
        }
        if (EventManager.SearchEventManager.Instance._bodyType != "")
        {
            querystring += "&body_type=" + WWW.EscapeURL(EventManager.SearchEventManager.Instance._bodyType);
        }
        if (EventManager.SearchEventManager.Instance._isImage != "")
        {
            querystring += "&is_image=" + EventManager.SearchEventManager.Instance._isImage;
        }
        if (EventManager.SearchEventManager.Instance._keyword != "")
        {
            querystring += "&keyword=" + EventManager.SearchEventManager.Instance._keyword;
        }

        _webView.OnLoadComplete += OnLoadComplete;

        url += querystring;
        Debug.Log(url + " U R L ");
        _webView.url = url;


        _webView.backButtonEnable         = false;
        _webView.autoShowWhenLoadComplete = true;
        _webView.SetTransparentBackground(true);
        _webView.AddUrlScheme("profile");
        // 設定サイズを取得
        //WebviewLayout.InsetsParameter wInsets = WebviewLayout.GetInsetsWebview (0.1785f, 0.0f, 0.097f);
        WebviewLayout.InsetsParameter wInsets = WebviewLayout.GetInsetsWebview(0.19f, 0.0f, 0.2f);
        _webView.insets = new UniWebViewEdgeInsets(wInsets.top, wInsets.side, wInsets.bottom, wInsets.side);
        //_webView.SetShowSpinnerWhenLoading (true);
        _webView.OnReceivedMessage += OnReceivedMessage;
        _webView.Load();
    }