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

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

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