Esempio n. 1
0
        public bool Contains(string path)
        {
            string      assetName = FilePathUtil.GetFileNameWithoutExtension(path);
            StaticAsset asset     = Assets.Find((x) => (x.Asset.name == assetName));

            return(asset != null);
        }
Esempio n. 2
0
        public AssetFile FindAssetFile(string filePath, AssetFileManagerSettings settings, StringGridRow rowData)
        {
            if (Assets == null)
            {
                return(null);
            }
            string      assetName = FilePathUtil.GetFileNameWithoutExtension(filePath);
            StaticAsset asset     = Assets.Find((x) => (x.Asset.name == assetName));

            if (asset == null)
            {
                return(null);
            }

            return(new StaticAssetFile(asset, filePath, settings.FindSettingFromPath(filePath), rowData));
        }
Esempio n. 3
0
        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));
        }
Esempio n. 4
0
        public StaticAssetFile(StaticAsset asset, string filePath, AssetFileSetting setting, StringGridRow rowData)
            : base(filePath, setting, rowData)
        {
            this.Asset = asset;
            TextAsset textAsset = Asset.Asset as TextAsset;

            if (null != textAsset)
            {
                Text  = textAsset.text;
                Bytes = textAsset.bytes;
                bool isTsv = (LoadFlags & AssetFileLoadFlags.Tsv) != AssetFileLoadFlags.None;
                Csv = new StringGrid(FileName, isTsv ? CsvType.Tsv : CsvType.Csv, textAsset.text);
            }
            this.Sprite            = Asset.Asset as Sprite;
            this.Texture           = Asset.Asset as Texture2D;
            this.Sound             = Asset.Asset as AudioClip;
            this.UnityObject       = Asset.Asset;
            this.IsLoadEndOriginal = true;
        }
Esempio n. 5
0
 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;
     }
 }