Home > Backend Development > PHP Tutorial > Can Unity WWW and AssetBundle just throw the assets on the server? adt bundle bundle what does adt-bundle-window mean

Can Unity WWW and AssetBundle just throw the assets on the server? adt bundle bundle what does adt-bundle-window mean

WBOY
Release: 2016-07-29 08:53:14
Original
2346 people have browsed it

The answer is definitely no
1. In order to actually verify the actual effect of this function, I am prepared to die
1. One server, one domain name: Rent an Alibaba Cloud server (the minimum configuration is more than 70 yuan a month) and buy a domain name (the first purchase only costs 4-9 yuan)
2. Install an http server. I use Nginx server. I don’t know how to configure the specific Apache service.
3. Read the introduction of momo’s AssetBundle function

2. Function implementation - (server)
1. Create a directory on the server, and then throw the resources to the server
assetbundle打包,ngui assetbundle,assetbundle打包场景,unity assetbundle,assetbundle 场景,assetbundle操作步骤,bundle mainasset,unity3d assetbundle,一键打包assetbundle,assetbundle 更新目录,assetbundle解包,unity5 assetbundle,adt bundle,bundle是什么意思,adt-bundle-window
Here is the directory on my server (it is unethical to attack other people's servers at will)
assetbundle打包,ngui assetbundle,assetbundle打包场景,unity assetbundle,assetbundle 场景,assetbundle操作步骤,bundle mainasset,unity3d assetbundle,一键打包assetbundle,assetbundle 更新目录,assetbundle解包,unity5 assetbundle,adt bundle,bundle是什么意思,adt-bundle-window

2. Change the configuration file on the server, otherwise an error 403 or 404 will be reported. My server configuration is like this (it is unethical to attack other people's servers at will) servers are immoral), if you don’t understand server conf, educate yourself. .
assetbundle打包,ngui assetbundle,assetbundle打包场景,unity assetbundle,assetbundle 场景,assetbundle操作步骤,bundle mainasset,unity3d assetbundle,一键打包assetbundle,assetbundle 更新目录,assetbundle解包,unity5 assetbundle,adt bundle,bundle是什么意思,adt-bundle-window
3. Function implementation - (client)

<code><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);
    }</code>
Copy after login

4. Call successful
The latter sentence is printed by the loaded gameobject. The example is momo's big resource package
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); }); });

The above introduces Unity WWW and AssetBundle. Is it enough to just throw the resources on the server? , including bundle and asset content, I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template