Unity WWW 和 AssetBundle只要將資源丟在伺服器上就可以了嗎? adt bundle bundle是什麼意思 adt-bundle-window

WBOY
發布: 2016-07-29 08:53:14
原創
2296 人瀏覽過

答案肯定是否定的
一、為了實際驗證這個功能的實際作用,我作死的準備
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
三、功能實作-(客戶端)

<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>
登入後複製

四、呼叫成功
後面那一句是載入的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教程有興趣的朋友有所幫助。

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!