UniWebView插件的使用
生活随笔
收集整理的這篇文章主要介紹了
UniWebView插件的使用
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
uniwebview插件可以在unity內部打開網頁,不過這個插件只能在安卓和IOS上運行,unity的editor下是運行不起來的,下面說下用法:
private UniWebView webView; public GameObject go; void OpenURL(string url){webView = go.GetComponent();if (webView == null){webView = go.AddComponent();}webView.url = url;//賦值地址webView.Load();//加載網頁webView.Show();//顯示網頁webView.OnWebViewShouldClose += showClose;//當網頁關閉的回調函數} private bool showClose(UniWebView webView){webView = null;return true;}這是打開一個網頁,參數為要打開網頁的地址,回調方法記得要把webView=null,如果不等于NULL的話,會有一些BUG,如果有興趣的可以自己測試一下
總結
以上是生活随笔為你收集整理的UniWebView插件的使用的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 前端学习(3064):vue+eleme
- 下一篇: Swipper.js实现轮播功能