private AssetFileBase AddSub(string path, IAssetFileSettingData settingData) { AssetFileBase base2; if (!this.fileTbl.TryGetValue(path, out base2)) { if (path.Contains(" ")) { Debug.LogWarning("[" + path + "] contains white space"); } AssetBundleInfo assetBundleInfo = this.AssetBundleInfoManager.FindAssetBundleInfo(path); AssetFileInfo fileInfo = new AssetFileInfo(path, this.settings, assetBundleInfo); base2 = this.StaticAssetManager.FindAssetFile(this, fileInfo, settingData); if (base2 == null) { base2 = this.CustomLoadManager.Find(this, fileInfo, settingData); if (base2 == null) { base2 = new AssetFileUtage(this, fileInfo, settingData); } } this.fileTbl.Add(path, base2); } return(base2); }
///***以下、ファイル追加・ロード処理***/// // 管理ファイルを追加 AssetFileBase AddSub(string path, IAssetFileSettingData settingData) { AssetFileBase file; //管理テーブルにあるなら、そこから if (!fileTbl.TryGetValue(path, out file)) { if (path.Contains(" ")) { Debug.LogWarning("[" + path + "] contains white space"); } AssetBundleInfo assetBundleInfo = AssetBundleInfoManager.FindAssetBundleInfo(path); AssetFileInfo fileInfo = new AssetFileInfo(path, settings, assetBundleInfo); //staticなアセットにあるなら、そこから file = StaticAssetManager.FindAssetFile(this, fileInfo, settingData); if (file == null) { //カスタムロードなアセットにあるなら、そこから file = CustomLoadManager.Find(this, fileInfo, settingData); if (file == null) { //宴形式の通常ファイルロード file = new AssetFileUtage(this, fileInfo, settingData); } } fileTbl.Add(path, file); } return(file); }
// 管理ファイルを追加 AssetFileBase AddSub(string path, IAssetFileSettingData settingData) { //管理テーブルにあるなら、そこから string path2 = GetPathChangedSoundExt(path); AssetFileBase file = FindFromTbl(path, path2, settingData); if (file != null) { return(file); } /* if (path.Contains(" ")) * { * Debug.LogWarning("[" + path + "] contains white space"); * } */ AssetBundleInfo assetBundleInfo = FindAssetBundleInfo(path, path2); AssetFileInfo fileInfo = new AssetFileInfo(path, settings, assetBundleInfo); //staticなアセットにあるなら、そこから file = StaticAssetManager.FindAssetFile(this, fileInfo, settingData); if (file == null) { //カスタムロードなアセットにあるなら、そこから file = CustomLoadManager.Find(this, fileInfo, settingData); if (file == null) { //宴形式の通常ファイルロード file = new AssetFileUtage(this, fileInfo, settingData); } } fileTbl.Add(path, file); return(file); }
private void FindAsset(AssetFileManager mangager, AssetFileInfo fileInfo, IAssetFileSettingData settingData, ref AssetFileBase asset) { if (this.IsVideoType(fileInfo, settingData)) { asset = new AdvLocalVideoFile(this, mangager, fileInfo, settingData); } }
// 最新バージョン番号でファイル情報を設定 AssetFileInfo SetFileVersionSub(string path, int version) { AssetFileInfo fileInfo = GetFileInfoCreateIfMissing(path); fileInfo.Version = version; return(fileInfo); }
public AssetFileBase(AssetFileManager mangager, AssetFileInfo fileInfo, IAssetFileSettingData settingData) { this.FileManager = mangager; this.FileInfo = fileInfo; this.FileType = fileInfo.FileType; this.SettingData = settingData; this.Priority = AssetFileLoadPriority.DownloadOnly; }
//ファイルのロードを上書き void FindAsset(AssetFileManager mangager, AssetFileInfo fileInfo, IAssetFileSettingData settingData, ref AssetFileBase asset) { if (IsVideoType(fileInfo, settingData)) { //宴形式の通常ファイルロード asset = new AdvLocalVideoFile(this, mangager, fileInfo, settingData); } }
// AudioClip WriteCacheFileSound { get; } // byte[] CacheWriteBytes { get; } /// <summary> /// コンストラクタ /// </summary> /// <param name="info">ファイル情報</param> /// <param name="fileIO">ファイルのIO管理クラス</param> public AssetFileWork(AssetFileInfo info, FileIOManagerBase fileIO) { this.FileName = info.Key; this.FileInfo = info; this.fileIO = fileIO; this.status = STAUS.LOAD_WAIT; this.Priority = AssetFileLoadPriority.DownloadOnly; this.SubFiles = new Dictionary <string, AssetFile>(); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="info">ファイル情報</param> /// <param name="fileIO">ファイルのIO管理クラス</param> internal AssetFileUtage(AssetFileUtageManager manager, AssetFileInfo info, StringGridRow rowData, FileIOManagerBase fileIO) { this.manager = manager; this.fileIO = fileIO; this.FileName = info.Key; this.FileInfo = info; this.status = STAUS.LOAD_WAIT; this.Priority = AssetFileLoadPriority.DownloadOnly; this.SubFiles = new Dictionary <string, AssetFile>(); this.RowData = rowData; }
/// <summary> /// コンストラクタ /// </summary> /// <param name="reader"></param> /// <param name="fileVersion">バイナリリーダー</param> public static AssetFileInfo ReadOld(BinaryReader reader, AssetFileManagerSettings settings, ConvertFileListManager assetBundleManager) { string key = reader.ReadString(); reader.ReadInt32(); AssetFileInfo info = new AssetFileInfo(key, settings, assetBundleManager); info.cacheVersion = reader.ReadInt32(); info.cachePath = reader.ReadString(); reader.ReadInt32(); return(info); }
public AssetFileBase Find(AssetFileManager mangager, AssetFileInfo fileInfo, IAssetFileSettingData settingData) { if (this.OnFindAsset != null) { AssetFileBase asset = null; this.OnFindAsset(mangager, fileInfo, settingData, ref asset); if (asset != null) { return(asset); } } return(null); }
private bool IsVideoType(AssetFileInfo fileInfo, IAssetFileSettingData settingData) { if (fileInfo.FileType != AssetFileType.UnityObject) { return(false); } if (settingData is AdvCommandSetting) { AdvCommandSetting setting = settingData as AdvCommandSetting; return(setting.Command is AdvCommandVideo); } AdvGraphicInfo info = settingData as AdvGraphicInfo; return((info != null) && (info.FileType == "Video")); }
public AssetFileBase FindAssetFile(AssetFileManager mangager, AssetFileInfo fileInfo, IAssetFileSettingData settingData) { if (Assets == null) { return(null); } string assetName = FilePathUtil.GetFileNameWithoutExtension(fileInfo.FileName); StaticAsset asset = Assets.Find((x) => (x.Asset.name == assetName)); if (asset == null) { return(null); } return(new StaticAssetFile(asset, mangager, fileInfo, settingData)); }
// 指定タイプのキャッシュファイルを全て削除 void DeleteCacheFileAllSub(AssetFileType type) { List <string> removeFile = new List <string>(); foreach (string key in fileInfoTbl.Keys) { AssetFileInfo fileInfo = fileInfoTbl.GetValue(key); if (fileInfo.FileType == type) { removeFile.Add(key); } } foreach (string key in removeFile) { AssetFileInfo fileInfo = fileInfoTbl.GetValue(key); //キャッシュファイル削除 fileInfo.DeleteCache(); fileInfoTbl.Remove(key); } WriteCacheTbl(); }
public StaticAssetFile(StaticAsset asset, AssetFileManager mangager, AssetFileInfo fileInfo, IAssetFileSettingData settingData) : base(mangager, fileInfo, settingData) { this.Asset = asset; base.Text = this.Asset.Asset as TextAsset; base.Texture = this.Asset.Asset as Texture2D; base.Sound = this.Asset.Asset as AudioClip; base.UnityObject = this.Asset.Asset; base.IsLoadEnd = true; base.IgnoreUnload = true; if (base.Texture != null) { this.FileType = AssetFileType.Texture; } else if (base.Sound != null) { this.FileType = AssetFileType.Sound; } else if (base.UnityObject != null) { this.FileType = AssetFileType.UnityObject; } }
public AdvLocalVideoFile(AdvVideoLoadPathChanger pathChanger, AssetFileManager assetFileManager, AssetFileInfo fileInfo, IAssetFileSettingData settingData) : base(assetFileManager, fileInfo, settingData) { fileInfo.StrageType = AssetFileStrageType.Resources; if (settingData is AdvCommandSetting) { AdvCommandSetting setting = settingData as AdvCommandSetting; string str = setting.Command.ParseCell <string>(AdvColumnName.Arg1); string[] args = new string[] { pathChanger.RootPath, str }; base.LoadPath = FilePathUtil.Combine(args); } else { AdvGraphicInfo info = settingData as AdvGraphicInfo; string fileName = info.FileName; string[] textArray2 = new string[] { pathChanger.RootPath, fileName }; base.LoadPath = FilePathUtil.Combine(textArray2); } }
public SampleCustomFile(AssetFileManager mangager, AssetFileInfo fileInfo, IAssetFileSettingData settingData) : base(mangager, fileInfo, settingData) { }
public AssetFileBase FindAssetFile(AssetFileManager mangager, AssetFileInfo fileInfo, IAssetFileSettingData settingData) {
public AssetFileUtage(AssetFileManager assetFileManager, AssetFileInfo fileInfo, IAssetFileSettingData settingData) : base(assetFileManager, fileInfo, settingData) { this.LoadPath = ParseLoadPath(); }
void FindAsset(AssetFileManager mangager, AssetFileInfo fileInfo, IAssetFileSettingData settingData, ref AssetFileBase asset) { asset = new SampleCustomFile(mangager, fileInfo, settingData); }