UnityWebPlayer使用(1) 单机环境下在WinForm中使用Unity3d

今天工作需要,要把Unity3d嵌入WinForm中,具体怎么做网上都有教程的。

但是,按照教程来,即 在WinForm中添加UnityWebPlayer控件(这个是COM组件),结果无法正确显示。

此时界面为:

 

Error details是:

 

Src路径是.unity3d的全路径,路径正确的,如果路径错误的话,提示是:

 

注意此时我已经安装了UnityWebPlayer插件。(我搜索单机显示unity3d时,只找到说是要安装这个)

 

我工作的电脑是无法上网的,实际上以前在家里的时候按照教程,3d场景是能正确显示的。然后我把程序拿到上网机上实验(由于现在我还没用动态src代码,还要修改盘符以便路径正确,挺麻烦的)。发现上网机是可以的,只不过第一次加载很慢,很慢很慢!

而后把上网机断网,还是能打开。有希望了,并不是一定要联网。

 

后台肯定下载了什么东西了!

安装错误提示把UnityPlayer3.x.x-win32.zip下载下来了,但是里面不是安装包,都是些dll,根本不知道怎么用。

 

实际上我一开始怀疑IE临时文件里面有没有什么东西,但是找不到什么可疑的,copy出来文件名又会改变,放弃。

真不知道该怎么办了,没办法,搜索一下c盘中有什么和unity相关的吧,同时在注册表中也找一下(用unity搜),大概4次F3后 让我找到一个

"C:\\Users\\Administrator\\AppData\\LocalLow\\Unity\\WebPlayer\\loader\\UnityWebPluginAX.ocx"

HKEY_CLASSES_ROOT\CLSID\{444785F1-DE89-4295-863A-D46C3A781394}\InprocServer32

 

我的电脑上打开该目录,上升到WebPlayer文件夹,里面有

而上网机上打开WebPlayer,里面有

 

这个文件夹居然有50M,明显可疑!

 

把上网机上的copy到工作机上,打开,OK!可以了!!!

 

以前我第一次接触unity3d的时候也碰到过这个单机无法使用的问题,当时没解决。主要是不是一定要解决,那时属于个人研究性质的,反正用WebBrowser加载Flash Playerhtml文件时可以显示的,就到此为止了。这次是工作,必须解决,不然下一步没法进行。

看来“必须”很重要。

unity web playerWeb Player License Agreement PLEASE READ CAREFULLY: BY INSTALLING THE SOFTWARE (AS DEFINED BELOW), YOU (EITHER ON BEHALF OF YOURSELF AS AN INDIVIDUAL OR ON BEHALF OF AN ENTITY AS ITS AUTHORIZED REPRESENTATIVE) AGREE TO ALL OF THE TERMS OF THIS END USER LICENSE AGREEMENT REGARDING THE USE OF THE SOFTWARE. 1) GRANT OF LICENSE: You may install this Software on your computer to experience Unity web content. 2) TITLE: You acknowledge that no title to the intellectual property in the Software is transferred to you. Title, ownership, rights, and intellectual property rights in and to the Software shall remain that of Unity Technologies. The Software is protected by copyright laws of the United States and international treaties. 3) ANONYMOUS USAGE STATISTICS: You accept that the first time the Unity Web Player is used, anonymous information about the computer it's loaded on is submitted to Unity Technologies ApS. This only happens once time, and contains no personally identifiable information. The information submitted is: (a) Operating system and version (b) The make of the CPU, and number of CPUs present (c) The graphics card type and vendor name (d) Graphics card driver name and version (example: "nv4disp.dll 6.10.93.71") (e) Which graphics API is in use (example: "OpenGL 2.1" or "Direct3D 9.0c") (f) Amount of system and video RAM present (g) Current desktop resolution (h) Version of the Unity Web Player (i) A number describing whether running on Mac or Windows (j) A checksum of all the data that gets sent to verify that it did transmit correctly 3) DISTRIBUTION: You acknowledge that only Unity Technologies ApS and its designated distribution partners may distribute the Unity Web Player, without a special permission.
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值