public void UpdateObjectsIntoCache(APAssetType type, APAsset asset, Queue <APAsset> modifedAssets = null) { if (APCache.HasAsset(type, asset.Id)) { APCache.SetValue(type, asset.Id, asset); if (modifedAssets != null) { modifedAssets.Enqueue(asset); } } }
public void UpdateObjectsIntoCache(APAssetType type, string assetid, Queue <APAsset> modifedAssets = null) { APAsset asset = APResources.GetAPAssetByPath(type, assetid); if (APCache.HasAsset(type, assetid)) { var previousAssets = APCache.GetValue(type, assetid); if (asset != null && previousAssets != null) { asset.Used = previousAssets.Used; APCache.SetValue(type, assetid, asset); if (modifedAssets != null) { modifedAssets.Enqueue(asset); } } } }
private static void HandleImportedAssets(string[] importedAssets) { foreach (var assetPath in importedAssets) { var id = AssetDatabase.AssetPathToGUID(assetPath); if (!APCache.HasAsset(id)) { AddNewImportAssets(assetPath); } else { UpdateReimportExistAssets(assetPath); } } webCommunicationService.RefreshIconCache(); }
public static List <APOtherFile> GetOthers() { List <APOtherFile> files = new List <APOtherFile>(); var allfiles = Utility.GetFilesInRelativePath(Application.dataPath); foreach (var file in allfiles) { string filePath = "Assets" + file; var guid = AssetDatabase.AssetPathToGUID(filePath); if (APCache.HasAsset(guid)) { continue; } files.Add(GetOtherFile(filePath)); } return(files); }