Exemple #1
0
 private void OnDisable()
 {
     if (WebView2Native.IsActive())
     {
         WebView2Native.Close();
     }
 }
Exemple #2
0
        private void OnPressOpenButton()
        {
            WebView2Native.Create("https://google.co.jp");
            WebView2Native.UpdateBound(UIHelper.GetCanvasRectangle(ImageRef.rectTransform));

            ButtonTextRef.text = "Close";
        }
Exemple #3
0
 private void OnDestroy()
 {
     if (WebView2Native.IsActive())
     {
         WebView2Native.Close();
     }
 }
Exemple #4
0
 private void OnApplicationQuit()
 {
     if (WebView2Native.IsActive())
     {
         WebView2Native.Close();
     }
 }
Exemple #5
0
 private void OnPressButton()
 {
     if (WebView2Native.IsActive())
     {
         OnPressCloseButton();
     }
     else
     {
         OnPressOpenButton();
     }
 }
Exemple #6
0
        private IEnumerator delayNavigate()
        {
            yield return(new WaitForSeconds(1.0f));

            WebView2Native.NavigateToHTML("<html><body><h1>Hello, WebView2!</h1></body></html>");
        }
Exemple #7
0
 private void OnPressCloseButton()
 {
     WebView2Native.Close();
     ButtonTextRef.text = "Open";
 }
Exemple #8
0
 // Update is called once per frame
 void Update()
 {
     WebView2Native.UpdateBound(UIHelper.GetCanvasRectangle(ImageRef.rectTransform));
 }