unity3d UniWebView插件的使用和经验
生活随笔
收集整理的這篇文章主要介紹了
unity3d UniWebView插件的使用和经验
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
UniWebView插件適用于安卓和iOS端,在PC無法使用。
解決按到返回鍵導致無法打開Web頁面的方法: 每次打開web頁面都使用一個新的uniwebview組件。
using System.Collections; using System.Collections.Generic; using UnityEngine;public class web : MonoBehaviour {public Transform WebParent; //存放web組件預制體的父節點 public RectTransform Panel; //web 頁面打開的位置private GameObject go;private UniWebView web1;void Start(){go = Resources.Load<GameObject>("UniWebView");}public void Open(){for (int i = WebParent.childCount-1; i >=0; i--){Destroy(WebParent.GetChild(i).gameObject);}GameObject a = Instantiate(go, WebParent);web1 = a.GetComponent<UniWebView>();web1.ReferenceRectTransform = Panel;web1.Show();web1.Load("https://www.baidu.com");}public void close(){web1.Hide();} }?
總結
以上是生活随笔為你收集整理的unity3d UniWebView插件的使用和经验的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 前端学习(2979):vue-eleme
- 下一篇: 全新的 Vue3 状态管理工具:Pini