Exemple #1
0
        //アセットバンドルのリストを取得
        List <MainAssetInfo> GetAssetBudleList(AssetFileManagerSettings settings)
        {
            List <MainAssetInfo> assets = new List <MainAssetInfo>();

            //指定ディレクトリ以下のアセットを全て取得
            MainAssetInfo inputDirAsset = new MainAssetInfo(AssetBundleDirectory);

            foreach (MainAssetInfo asset in inputDirAsset.GetAllChidren())
            {
                if (asset.IsDirectory)
                {
                    continue;
                }
                if (IsIgnoreAssetBundle(asset))
                {
                    continue;
                }
                AssetFileSetting    assetFileSetting = settings.FindSettingFromPath(asset.AssetPath);
                AssetFileEncodeType encodeType       = assetFileSetting.EncodeType;
                switch (encodeType)
                {
                case AssetFileEncodeType.AssetBundle:
                    assets.Add(asset);
                    break;

                default:
                    break;
                }
            }

            return(assets);
        }
        void EditDirectroy(MainAssetInfo directory)
        {
            if (!directory.IsDirectory)
            {
                return;
            }

            foreach (MainAssetInfo asset in directory.GetAllChidren())
            {
                if (asset.Asset as MonoScript != null)
                {
                    EditScript(asset);
                }
            }
        }
Exemple #3
0
        //リソースファイルをバージョンアップ
        public void VersionUpResouces(string keyFiles, Object resourcesDir, bool isOnlyNew)
        {
            //指定ディレクトリ以下のアセットを全て取得
            MainAssetInfo        inputDirAsset = new MainAssetInfo(resourcesDir);
            List <MainAssetInfo> assets        = inputDirAsset.GetAllChidren();

            string inputDir = inputDirAsset.AssetPath;

            List <ConvertFileList.CusomFileVersionUpInfo> customFileVersionUpInfoList = new List <ConvertFileList.CusomFileVersionUpInfo>();
            int convertFileCount = 0;
            int versionUpCount   = 0;

            foreach (MainAssetInfo asset in assets)
            {
                if (asset.IsDirectory)
                {
                    continue;
                }
                AssetFileSetting    assetFileSetting = Settings.FindSettingFromPath(asset.AssetPath);
                AssetFileEncodeType encodeType       = assetFileSetting.EncodeType;
                switch (encodeType)
                {
                case AssetFileEncodeType.AlreadyEncoded:
                {
                    ++convertFileCount;
                    bool isVersionUp = TryConvertToUtageFile(asset, inputDir, isOnlyNew);
                    if (isVersionUp)
                    {
                        ++versionUpCount;
                    }
                    string fileKey = FilePathUtil.RemoveDirectory(asset.AssetPath, inputDir);
                    customFileVersionUpInfoList.Add(new ConvertFileList.CusomFileVersionUpInfo(fileKey, isVersionUp));
                }
                break;

                default:
                    break;
                }
            }
            ConvertFileList.EditorVersionUp(keyFiles, customFileVersionUpInfoList);

            Debug.Log(string.Format("{0}/{1}files version up", versionUpCount, convertFileCount));
        }