Unity WWW 和 AssetBundle只要将资源扔在服务器上就可以了吗? adt bundle bundle是什么意思 adt-bundle-window

php中文网
发布: 2016-07-29 08:53:14
原创
2567人浏览过

答案肯定是否定的
一、为了实际验证这个功能的实际作用,我作死的准备
1、一个服务器,一个域名:租个阿里云服务器(最低配置70多元一个月),买个域名(首次购买只要4-9元哦)
2、安装一个http服务器,我用的是Nginx服务器,具体Apache的服务不知道是怎么配置。
3、看了momo的AssetBundle功能介绍

二、功能实现-(服务器)
1、在服务器上创建个目录,然后把资源扔到服务器上去
assetbundle打包,ngui assetbundle,assetbundle打包场景,unity assetbundle,assetbundle 场景,assetbundle操作步骤,bundle mainasset,unity3d assetbundle,一键打包assetbundle,assetbundle 更新目录,assetbundle解包,unity5 assetbundle,adt bundle,bundle是什么意思,adt-bundle-window
这里我的服务器上的目录是(随意攻击人家的服务器是不道德的)
assetbundle打包,ngui assetbundle,assetbundle打包场景,unity assetbundle,assetbundle 场景,assetbundle操作步骤,bundle mainasset,unity3d assetbundle,一键打包assetbundle,assetbundle 更新目录,assetbundle解包,unity5 assetbundle,adt bundle,bundle是什么意思,adt-bundle-window

2、更改服务器上的配置文件,否则会报错403或者404,我的服务器配置是这样的(随意攻击人家的服务器是不道德的),不懂服务器conf的去自学。。
assetbundle打包,ngui assetbundle,assetbundle打包场景,unity assetbundle,assetbundle 场景,assetbundle操作步骤,bundle mainasset,unity3d assetbundle,一键打包assetbundle,assetbundle 更新目录,assetbundle解包,unity5 assetbundle,adt bundle,bundle是什么意思,adt-bundle-window
三、功能实现-(客户端)

<span>public</span><span>static</span><span>readonly</span><span>string</span> PathURL = <span>"http://wangpeng.online:10001/Prefab0.assetbundle"</span>;
<span>void</span> OnGUI()
    {
        <span>if</span>(GUILayout.Button(<span>"TestAssetBundle"</span>))
        {
            StartCoroutine(LoadGameObject(PathURL));
        }
    }

<span>private</span> IEnumerator <span>LoadALLGameObject</span>(<span>string</span> path)
    {
         WWW bundle = <span>new</span> WWW(path);

         <span>yield</span><span>return</span> bundle;


        <span>if</span>(!<span>string</span>.IsNullOrEmpty(bundle.error))
        {
            Debug.Log(<span>"ERROR:"</span>+bundle.error);

        }<span>else</span>{
            Debug.Log(<span>"SUCCESS TO DOWNLOAD:"</span>+bundle.bytesDownloaded);
        }
        <span>yield</span><span>return</span><span>0</span>;
         <span>//通过Prefab的名称把他们都读取出来</span>
        Object  obj0 = bundle.assetBundle.LoadAsset<Object>(<span>"Prefab0"</span>);
         <span>//加载到游戏中   </span><span>yield</span><span>return</span> Instantiate(obj0);
    }
登录后复制

四、调用成功
后面那一句是加载的gameobject打印的,例子是momo大大的资源包
assetbundle打包,ngui assetbundle,assetbundle打包场景,unity assetbundle,assetbundle 场景,assetbundle操作步骤,bundle mainasset,unity3d assetbundle,一键打包assetbundle,assetbundle 更新目录,assetbundle解包,unity5 assetbundle,adt bundle,bundle是什么意思,adt-bundle-window

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

以上就介绍了Unity WWW 和 AssetBundle只要将资源扔在服务器上就可以了吗?,包括了bundle,asset方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号