Unity内嵌网页

插件

uniwebview

支持IOS、Android,支持MacOS下Editor调试,但不支持PC以及Windows下Editor调试。

Embedded Browser

支持PC、MacOS,不支持Android和IOS。

3dwebview

PC、MacOS、IOS和Android都支持,但似乎用的人比较少,不知道有没有什么问题,且价格比较高,将近500美金。

SimpleWebView

PC客户端内嵌网页

PC平台内置网页使用

Embedded Browser插件

AssetStore地址
官方介绍网站

限制

视频播放:
This Asset does not include licenses for proprietary or patent-encumbered codecs such as h.264. (Most streaming sites use patent-encumbered codecs and will not work. YouTube videos generally work, unless they are live.) Consider re-encoding your content with an open codec supported by stock Chromium such as WebM or Ogg Vorbis.
最好用WebM或者Ogg视频格式

All activity (mouse clicks, JS calls, input) is sent asynchronously to a separate renderer process and the results are asynchronously reported back. As such, there is a short delay between when a command is issued and when the results are visible. The delay should be quite reasonable in most cases, but don’t expect results the same frame you issue a command.
输入,调用方法等指令的接收和返回信息都是异步的,会有延迟

使用

内嵌资源:要在Assets同级文件夹下建一个名为BrowserAssets的文件夹

localGame://
去访问该文件夹下对应资源

几种通讯形式

unity发布成WebGL的项目和网页的通讯

官方文档有

unity项目和项目内置网页的通讯

插件自带的话可以用插件提供的方法

unity项目和网页的通讯(两者独立)

此方法是项目去连接web服务器,达到和网页端的通讯
项目使用websocket和web服务器连接,web服务器转发给网页
socketio 两端都有插件

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值