资源简介

在Asset bundle 打包管理上采用了全新的方式,不需要再对每个文件进行MD5比对,unity已经帮我们做好了,对需要打包的资源AssetBundle属性就行了,同事Unity还提供了一个打包管理工具 Asset Bundle Manager。

资源截图

代码片段和文件信息

using System;
using System.Collections;
using UnityEngine;

namespace AssetBundles
{
    /// 
    ///     An asynchronous wrapper for the AssetBundleManager downloading system
    /// 

    public class AssetBundleAsync : IEnumerator
    {
        public AssetBundle AssetBundle;

        public bool IsDone { get; private set; }
        public bool Failed { get; private set; }

        public AssetBundleAsync(string bundleName Action> callToAction)
        {
            IsDone = false;
            callToAction(bundleName OnAssetBundleComplete);
        }

        public AssetBundleAsync()
        {
            IsDone = true;
            Failed = true;
        }

        private void OnAssetBundleComplete(AssetBundle bundle)
        {
            AssetBundle = bundle;
            Failed = bundle == null;
            IsDone = true;
        }

        public bool MoveNext()
        {
            return !IsDone;
        }

        public void Reset()
        { }

        public object Current {
            get { return null; }
        }
    }

    /// 
    ///     An asynchronous wrapper for the AssetBundleManager manifest downloading system
    /// 

    public class AssetBundleManifestAsync : IEnumerator
    {
        public bool Success { get; private set; }
        public bool IsDone { get; private set; }

        public AssetBundleManifestAsync(string bundleName Action> callToAction)
        {
            IsDone = false;
            callToAction(bundleName OnAssetBundleManifestComplete);
        }

        private void OnAssetBundleManifestComplete(AssetBundle bundle)
        {
            Success = bundle != null;
            IsDone = true;
        }

        public bool MoveNext()
        {
            return !IsDone;
        }

        public void Reset()
        { }

        public object Current {
            get { return null; }
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-08-22 03:57  AssetBundleManager-master\
     文件         214  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager.meta
     文件        2508  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager.sln.DotSettings
     文件         175  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager.sln.DotSettings.meta
     目录           0  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager\
     文件        1983  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager\AssetBundleAsync.cs
     文件          86  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager\AssetBundleAsync.cs.meta
     文件        6403  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager\AssetBundleDownloader.cs
     文件         263  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager\AssetBundleDownloader.cs.meta
     文件        1237  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager\AssetBundleDownloaderMonobehaviour.cs
     文件         263  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager\AssetBundleDownloaderMonobehaviour.cs.meta
     文件          37  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager\AssetBundleManager.asmdef
     文件         207  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager\AssetBundleManager.asmdef.meta
     文件       24103  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager\AssetBundleManager.cs
     文件         263  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager\AssetBundleManager.cs.meta
     文件        3327  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager\AssetBundleUtility.cs
     文件         263  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager\AssetBundleUtility.cs.meta
     文件        2462  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager\EditorCoroutine.cs
     文件         263  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager\EditorCoroutine.cs.meta
     文件         192  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager\Example.meta
     目录           0  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager\Example\
     文件         896  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager\Example\Example1.cs
     文件         263  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager\Example\Example1.cs.meta
     文件         873  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager\Example\Example2.cs
     文件         263  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager\Example\Example2.cs.meta
     文件         112  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager\ICommandHandler.cs
     文件         263  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager\ICommandHandler.cs.meta
     文件        3778  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager\StreamingAssetsBundleDownloadDecorator.cs
     文件          86  2018-08-22 03:57  AssetBundleManager-master\AssetBundleManager\StreamingAssetsBundleDownloadDecorator.cs.meta
     文件        1074  2018-08-22 03:57  AssetBundleManager-master\LICENSE
     文件         175  2018-08-22 03:57  AssetBundleManager-master\LICENSE.meta
............此处省略2个文件信息

评论

共有 条评论