예제 #1
0
        private static void HandleDeletedAssets(string[] deletedAssets)
        {
            var animationClips = APCache.GetAssetsListByTypeFromCache <APAnimation>(APAssetType.AnimationClip);

            foreach (var assetPath in deletedAssets)
            {
                Utility.DebugLog(string.Format("Deleted: {0}", assetPath));

                if (Utility.IsModelPath(assetPath))
                {
                    foreach (var clip in animationClips)
                    {
                        if (clip.Path.Contains(assetPath))
                        {
                            APCache.Remove(APAssetType.AnimationClip, clip.Id);
                            SyncManager.DeleteAssets.Enqueue(clip);
                            SyncManager.DeleteAssets.Enqueue(APResources.GetBlackListAPAsset(assetPath));
                        }
                    }
                }

                var id    = AssetDatabase.AssetPathToGUID(assetPath);
                var asset = APCache.GetValue(AssetDatabase.AssetPathToGUID(assetPath));
                if (asset != null)
                {
                    APCache.Remove(id);
                    APCache.RemoveFromBlacklist(assetPath);
                    SyncManager.DeleteAssets.Enqueue(asset);
                    SyncManager.DeleteAssets.Enqueue(APResources.GetBlackListAPAsset(assetPath));
                }
            }
        }
        private void DeleteFromBlacklist(string paths, object callback)
        {
            var assetPaths = paths.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

            if (assetPaths.Length == 0)
            {
                return;
            }

            foreach (string path in assetPaths)
            {
                APCache.RemoveFromBlacklist(path);
            }

            APCache.CommitBlacklistChange();
        }
예제 #3
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();
        }