Пример #1
0
        //独自定義ファイルをバージョンアップする。バージョンアップチェックはしない(Eidtor上のみ使用可能)
        public void EditorVersionUp(string key, List <CusomFileVersionUpInfo> cusomFileVersionUpInfoList)
        {
            ConvertFileInfoDictionary oldInfoList;

            FileLists.TryGetValue(key, out oldInfoList);
            ConvertFileInfoDictionary newInfoList = new ConvertFileInfoDictionary(this, key);

            foreach (var versionUpInfo in cusomFileVersionUpInfoList)
            {
                ConvertFileInfo info;
                if (oldInfoList != null && oldInfoList.TryGetValue(versionUpInfo.Name, out info))
                {
                    if (versionUpInfo.IsVersionUp)
                    {
                        info.VersionUp();
                    }
                }
                else
                {
                    info = new ConvertFileInfo(versionUpInfo.Name, newInfoList);
                }
                if (newInfoList.ContainsKey(info.Name))
                {
                    Debug.LogError(info.Name + " is already contains ");
                    continue;
                }
                newInfoList.Add(info.Name, info);
            }
            FileLists.Remove(key);
            FileLists.Add(key, newInfoList);
        }
Пример #2
0
        //データをバージョンアップする(Eidtor上のみ使用可能)
        public int EditorVersionUpAssetBundle(AssetBundleManifest manifest, UnityEditor.BuildTarget buildTarget)
        {
            int    count          = 0;
            string buildTargetKey = AssetBundleHelper.BuildTargetToBuildTargetFlag(buildTarget).ToString();
            ConvertFileInfoDictionary oldInfoList;

            FileLists.TryGetValue(buildTargetKey, out oldInfoList);

            ConvertFileInfoDictionary newInfoList = new ConvertFileInfoDictionary(this, buildTargetKey);

            foreach (string assetBundleName in manifest.GetAllAssetBundles())
            {
                ConvertFileInfo info;
                if (oldInfoList != null && oldInfoList.TryGetValue(assetBundleName, out info))
                {
                    if (info.VersionUp(manifest))
                    {
                        ++count;
                    }
                }
                else
                {
                    info = new ConvertFileInfo(assetBundleName, manifest, newInfoList);
                    ++count;
                }
                newInfoList.Add(info.Name, info);
            }
            FileLists.Remove(newInfoList.Key);
            FileLists.Add(newInfoList.Key, newInfoList);
            return(count);
        }