Exemple #1
0
        List <ConvertFileList.CusomFileVersionUpInfo> VersionUpScenrioSub(AdvFileListConverter converter)
        {
            List <ConvertFileList.CusomFileVersionUpInfo> list = new List <ConvertFileList.CusomFileVersionUpInfo>();

            AdvExcelCsvConverter excelConverter             = new AdvExcelCsvConverter();
            List <AdvExcelCsvConverter.CsvInfo> csvInfoList = new List <AdvExcelCsvConverter.CsvInfo>();

            foreach (AdvScenarioDataProject.ChapterData item in ProjectSetting.ChapterDataList)
            {
                if (!excelConverter.TryConvertToCsvList(item.ExcelPathList, item.chapterName, 0, ref csvInfoList))
                {
                    throw new System.Exception("Convert is failed");
                }
            }

            int count = 0;

            foreach (AdvExcelCsvConverter.CsvInfo csvInfo in csvInfoList)
            {
                ConvertFileList.CusomFileVersionUpInfo versionUpInfo;
                if (converter.TryVersionUpFileFromMem(csvInfo.Path + ExtensionUtil.TSV, System.Text.Encoding.UTF8.GetBytes(csvInfo.Grid.ToText()), out versionUpInfo))
                {
                    ++count;
                }
                list.Add(versionUpInfo);
            }
            Debug.Log(string.Format("Scenairo {0}/{1} files updateted", count, csvInfoList.Count));
            return(list);
        }
Exemple #2
0
 //ローカルのリソースをバージョンアップ
 void VersionUpLocalFiles(AdvFileListConverter converter)
 {
     if (IsConvertResources)
     {
         VersionUpResources(converter);
     }
 }
Exemple #3
0
 //特殊設定のリソースやシナリオをバージョンアップ
 void VersionUpAdvanceFiles(AdvFileListConverter converter)
 {
     if (IsConvertResources)
     {
         VersionUpResources(converter);
     }
     if (IsConvertScenario)
     {
         VersionUpScenrio(converter);
     }
 }
Exemple #4
0
        //アセットバンドルのビルド
        void BuildAssetBundles(string outPutDirectoryPath, FileIOManager fileIOManager, AssetFileManagerSettings settings, bool isOutputLog)
        {
            if (assetBundleBuildMode == AssetBundleBuildMode.None)
            {
                return;
            }

            //アセットバンドルをプラットフォーム別にビルド
            List <BuildTarget> buildTargets = new List <BuildTarget>();

            switch (assetBundleBuildMode)
            {
            case AssetBundleBuildMode.OnlyEditor:                    //エディタ上のみ
                buildTargets.Add(EditorUserBuildSettings.activeBuildTarget);
                break;

            case AssetBundleBuildMode.AllPlatform:                    //全プラットフォーム
            {
                buildTargets = AssetBundleHelper.BuildTargetFlagsToBuildTargetList(buildTargetFlags);
            }
            break;

            default:
                break;
            }

            List <MainAssetInfo> assets = GetAssetBudleList(settings);

            RenameAssetBundles(assets);
            AssetBundleBuild[] builds = ToAssetBundleBuilds(assets);
            if (builds.Length <= 0)
            {
                return;
            }


            foreach (BuildTarget buildTarget in buildTargets)
            {
                string outputPath = FilePathUtil.Combine(outPutDirectoryPath, AssetBundleHelper.BuildTargetToBuildTargetFlag(buildTarget).ToString());
                //出力先のディレクトリを作成
                if (!Directory.Exists(outputPath))
                {
                    Directory.CreateDirectory(outputPath);
                }
                //アセットバンドルを作成
                AssetBundleManifest manifest = BuildPipeline.BuildAssetBundles(outputPath, builds, BuildAssetBundleOptions.None, buildTarget);

                //アセットバンドルの情報をバージョンアップ
                AdvFileListConverter converter = new AdvFileListConverter(outputPath, fileIOManager, settings);
                converter.VersionUp(
                    (x) =>
                {
                    int count = x.ConvertFileList.EditorVersionUpAssetBundle(manifest, buildTarget);
                    Debug.Log("" + count + " AsseBundle version up to target " + buildTarget.ToString());
                });
                if (isOutputLog)
                {
                    converter.WriteLog(true);
                }
            }
        }
Exemple #5
0
 //シナリオのバージョンアップ
 void VersionUpScenrio(AdvFileListConverter converter)
 {
     converter.ConvertFileList.EditorVersionUp(KeyScenario, VersionUpScenrioSub(converter));
 }
Exemple #6
0
 //リソースのバージョンアップ
 void VersionUpResources(AdvFileListConverter converter)
 {
     converter.VersionUpResouces(KeyResouces, ResourcesDirectory, IsOnlyNew);
 }
Exemple #7
0
        //ファイルのコンバート
        void Convert()
        {
            try
            {
                AssetFileManager assetFileManager = FindObjectOfType <AssetFileManager>();
                if (assetFileManager == null)
                {
                    Debug.LogError("FileManager is not found in current scene");
                    return;
                }
                //ファイルの入出力に使う
                FileIOManager            fileIOManager = assetFileManager.FileIOManger;
                AssetFileManagerSettings settings      = assetFileManager.Settings;

                if (outputType == OutputType.Default)
                {
                    AssetFileManagerSettings.LoadType loadType = settings.LoadTypeSetting;
                    if (isOutputLocal && LocalDirectory != null)
                    {
                        //ローカルの場合は、LoadTypeをLocalCompressedに
                        settings.LoadTypeSetting = AssetFileManagerSettings.LoadType.LocalCompressed;
                        string output = new MainAssetInfo(LocalDirectory).FullPath;
                        //リソースをバージョンアップ
                        AdvFileListConverter converter = new AdvFileListConverter(output, fileIOManager, settings);
                        converter.VersionUp(VersionUpLocalFiles);
                        if (isOutputLocalLog)
                        {
                            converter.WriteLog(false);
                        }
                    }
                    if (isOutputServer && !string.IsNullOrEmpty(OutputServerResourcePath))
                    {
                        //サーバーの場合は、LoadTypeをServerに
                        settings.LoadTypeSetting = AssetFileManagerSettings.LoadType.Server;
                        //シナリオやリソースをバージョンアップ
                        AdvFileListConverter converter = new AdvFileListConverter(OutputServerResourcePath, fileIOManager, settings);
                        converter.VersionUp(VersionUpServerFiles);
                        if (isOutputServerLog)
                        {
                            converter.WriteLog(false);
                        }
                        //アセットバンドルをビルド
                        BuildAssetBundles(OutputServerResourcePath, fileIOManager, settings, isOutputServerLog);
                    }
                    settings.LoadTypeSetting = loadType;
                }
                else
                {
                    //シナリオやリソースをバージョンアップ
                    AdvFileListConverter converter = new AdvFileListConverter(AdvancedOutputPath, fileIOManager, settings);
                    converter.VersionUp(VersionUpAdvanceFiles);
                    if (isOutputAdvancedLog)
                    {
                        converter.WriteLog(false);
                    }
                    //アセットバンドルをビルド
                    BuildAssetBundles(AdvancedOutputPath, fileIOManager, settings, isOutputAdvancedLog);
                }

                AssetDatabase.Refresh();
            }
            catch (System.Exception e)
            {
                Debug.LogException(e);
            }
        }