protected virtual void OnEvaluateJavaScript(WWebView webView, string result) { if (status != null) { status.text = "OnEvaluateJavaScript : " + result; } }
protected virtual void OnStartNavigation(WWebView webView, string url) { if (status != null) { status.text = "OnStartNavigation : " + url; } }
protected virtual void OnNavigationFailed(WWebView webView, int code, string url) { if (status != null) { status.text = "OnNavigationFailed : errorcode: " + code; } }
protected virtual void OnEvaluateJavaScript(WWebView webView, string result) { DebugLog.DebugLogInfo("00ff00", "OnEvaluateJavaScript"); if (status != null) { status.text = "OnEvaluateJavaScript : " + result; } }
protected virtual void OnStartNavigation(WWebView webView, string url) { DebugLog.DebugLogInfo("00ff00", "OnStartNavigation"); if (status != null) { status.text = "OnStartNavigation : " + url; } }
protected virtual void OnNavigationFailed(WWebView webView, int code, string url) { DebugLog.DebugLogInfo("00ff00", "OnNavigationFailed"); if (status != null) { status.text = "OnNavigationFailed : errorcode: " + code; } }
protected virtual void OnReceiveMessage(WWebView webView, string message) { DebugLog.DebugLogInfo("00ff00", "OnReceiveMessage"); if (message == "wwebview://openfile/") { LoadLocalFile(); } else if (message == "wwebview://loadstring/") { LoadHTML(); } }
public void InitWebView(WWebView webView) { webView.OnStartNavigation += OnStartNavigation; webView.OnNavigationCompleted += OnNavigationCompleted; webView.OnNavigationFailed += OnNavigationFailed; webView.OnReceiveMessage += OnReceiveMessage; webView.OnEvaluateJavaScript += OnEvaluateJavaScript; webView.OnClose += OnClose; webView.Initialize(new Vector4(0, 100f, 0, 0), new Vector2(x, y)); //#if UNIWEBVIEW3_SUPPORTED //#else //webView.Initialize(new Vector4(0, margine, 0, margine), new Vector2(0, 0)); //#endif }
protected virtual void OnNavigationCompleted(WWebView webView, string data) { if (goBack != null) { goBack.interactable = webView.CanGoBack; } if (goForward != null) { goForward.interactable = webView.CanGoForward; } if (status != null) { status.text = "OnNavigationCompleted : " + data; } }
protected virtual void OnReceiveMessage(WWebView webView, string message) { if (message == "wwebview://openfile/") { LoadLocalFile(); } else if (message == "wwebview://loadstring/") { LoadHTML(); } if (status != null) { status.text = "OnReceiveMessage : " + message; } }
protected virtual bool OnClose(WWebView webView) { DebugLog.DebugLogInfo("00ff00", "OnClose"); //#if UNITY_EDITOR // NOTE: Keep in mind that you are just watching the DEMO now. // Destroy webview instance not WWebView component. webView.Destroy(); // Don't destroy WWebView component for this demo. // In most cases, you will return true to remove the component. return(false); //#else // // In "real" game, you will never quit your app since the webview is closed. // UnityEngine.Application.Quit(); // return true; //#endif }
protected virtual bool OnClose(WWebView webView) { // NOTE: Keep in mind that you are now watching the "DEMO". // In most cases, you simply return true to destory the webview modules(instance & component) if (status != null) { status.text = "OnClose"; } #if UNITY_EDITOR // In Editor mode, only destroy the webview instance not component. // Don't destroy WWebView component in this demo. webView.Destroy(); return(false); #else // In "real" game, you will never quit your game even if the webview has been closed. UnityEngine.Application.Quit(); return(true); #endif }
protected virtual void OnEvaluateJavaScript(WWebView webView, string result) { DebugLog.DebugLogInfo("00ff00", "OnEvaluateJavaScript"); }
protected virtual void OnStartNavigation(WWebView webView, string url) { DebugLog.DebugLogInfo("00ff00", "OnStartNavigation"); }
public void OnAddJavaScript(WWebView webView, string js_string) { webView.AddJavaScript(js_string); }
protected virtual void OnNavigationFailed(WWebView webView, int code, string url) { DebugLog.DebugLogInfo("00ff00", "OnNavigationFailed"); }
protected virtual void OnNavigationCompleted(WWebView webView, string data) { DebugLog.DebugLogInfo("00ff00", "OnNavigationCompleted"); }