コード例 #1
0
ファイル: WWebView.cs プロジェクト: RelinkaKing/UnityPC
        /// <summary>
        /// Navigate a url in current webview.
        /// </summary>
        /// <param name="url">The URL to be navigated</param>
        public void Navigate(string url)
        {
            Setup();

#if UNIWEBVIEW3_SUPPORTED
            UniWebViewInterface.Load(listener.Name, url, false);
#elif UNIWEBVIEW2_SUPPORTED
            UniWebViewPlugin.Load(listener.Name, url);
#else
            WWebViewPlugin.Load(listener.Name, url);
#endif
        }
コード例 #2
0
ファイル: WWebView.cs プロジェクト: RelinkaKing/UnityPC
        /// <summary>
        /// Navigate a local file in current webview.
        /// </summary>
        /// <param name="file">Full path file name to be navigated.</param>
        public void NavigateFile(string file)
        {
            Setup();

            string fullPath =
#if UNITY_EDITOR || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN || UNITY_IOS
                Path.Combine("file://" + Application.streamingAssetsPath, file);
#elif UNITY_WSA
                "ms-appx-web:///Data/StreamingAssets/" + file;
#elif UNITY_ANDROID
                Path.Combine("file:///android_asset/", file);
#else
                string.Empty;
#endif

#if UNIWEBVIEW3_SUPPORTED
            UniWebViewInterface.Load(listener.Name, fullPath, false);
#elif UNIWEBVIEW2_SUPPORTED
            UniWebViewPlugin.Load(listener.Name, fullPath);
#else
            WWebViewPlugin.Load(listener.Name, fullPath);
#endif
        }
コード例 #3
0
 /// <summary>
 /// Load a url in current web view.
 /// </summary>
 /// <param name="url">The url to be loaded. This url should start with `http://` or `https://` scheme. You could even load a non-ascii url text if it is valid.</param>
 /// <param name="skipEncoding">
 /// Whether UniWebView should skip encoding the url or not. If set to `false`, UniWebView will try to encode the url parameter before
 /// loading it. Otherwise, your original url string will be used as the url if it is valid. Default is `false`.
 /// </param>
 public void Load(string url, bool skipEncoding = false)
 {
     UniWebViewInterface.Load(listener.Name, url, skipEncoding);
 }
コード例 #4
0
ファイル: UniWebView.cs プロジェクト: zhaozdi/CasinosClient
 /// <summary>
 /// Load a url in current web view.
 /// </summary>
 /// <param name="url">The url to be loaded. This url should start with `http://` or `https://` scheme. You could even load a non-ascii url text if it is valid.</param>
 /// <param name="skipEncoding">
 /// Whether UniWebView should skip encoding the url or not. If set to `false`, UniWebView will try to encode the url parameter before
 /// loading it. Otherwise, your original url string will be used as the url if it is valid. Default is `false`.
 /// </param>
 /// <param name="readAccessURL">
 /// The URL to allow read access to. This parameter is only used when loading from the filesystem in iOS, and passed
 /// to `loadFileURL:allowingReadAccessToURL:` method of WebKit. By default, the parent folder of the `url` parameter will be read accessible.
 /// </param>
 public void Load(string url, bool skipEncoding = false, string readAccessURL = null)
 {
     UniWebViewInterface.Load(listener.Name, url, skipEncoding, readAccessURL);
 }