コード例 #1
0
        public static void AddToBlacklist()
        {
            List <APAsset> newBlacklist = new List <APAsset>();

            foreach (var item in Selection.objects)
            {
                var path = GetPathOfSelectedAssets(item);
                if (!APCache.ExistsInBlacklist(path))
                {
                    var asset = APResources.GetBlackListAPAsset(path);
                    APCache.AddToBlacklist(path, asset);
                    newBlacklist.Add(asset);
                }
            }

            AssetNotification.webCommunicationService.AddAssets(newBlacklist);
            APCache.CommitBlacklistChange();
        }
コード例 #2
0
        public static void RemoveBlacklist()
        {
            List <APAsset> deleteAssets = new List <APAsset>();

            foreach (var item in Selection.objects)
            {
                var path = GetPathOfSelectedAssets(item);
                if (APCache.ExistsInBlacklist(path))
                {
                    var asset = APResources.GetBlackListAPAsset(path);
                    APCache.RemoveFromBlacklist(path);
                    Utility.UpdateJsonInAsset(asset);
                    deleteAssets.Add(asset);
                }
            }

            AssetNotification.webCommunicationService.DeleteAssets(deleteAssets.ToArray().ToList());;
            APCache.CommitBlacklistChange();
        }