private void OnDisable() { if (WebView2Native.IsActive()) { WebView2Native.Close(); } }
private void OnPressOpenButton() { WebView2Native.Create("https://google.co.jp"); WebView2Native.UpdateBound(UIHelper.GetCanvasRectangle(ImageRef.rectTransform)); ButtonTextRef.text = "Close"; }
private void OnDestroy() { if (WebView2Native.IsActive()) { WebView2Native.Close(); } }
private void OnApplicationQuit() { if (WebView2Native.IsActive()) { WebView2Native.Close(); } }
private void OnPressButton() { if (WebView2Native.IsActive()) { OnPressCloseButton(); } else { OnPressOpenButton(); } }
private IEnumerator delayNavigate() { yield return(new WaitForSeconds(1.0f)); WebView2Native.NavigateToHTML("<html><body><h1>Hello, WebView2!</h1></body></html>"); }
private void OnPressCloseButton() { WebView2Native.Close(); ButtonTextRef.text = "Open"; }
// Update is called once per frame void Update() { WebView2Native.UpdateBound(UIHelper.GetCanvasRectangle(ImageRef.rectTransform)); }