Exemplo n.º 1
0
        public IEnumerable <string> GetAssetPaths()
        {
            foreach (var assetPath in FileAssetPaths.Where(AssetUtility.IsSupportedTextAssetPath))
            {
                yield return(assetPath);
            }

            foreach (var folderAssetPath in FolderAssetPaths)
            {
                foreach (var assetPath in AssetUtility.GetAssetPaths <TextAsset>(folderAssetPath))
                {
                    if (assetPath.GetAssetPathFolder() == folderAssetPath)
                    {
                        yield return(assetPath);
                    }
                }
            }

            foreach (var folderAssetPath in RootAssetPaths)
            {
                foreach (var assetPath in AssetUtility.GetAssetPaths <TextAsset>(folderAssetPath))
                {
                    yield return(assetPath);
                }
            }
        }
Exemplo n.º 2
0
        public bool ContainsAsset(string assetPath)
        {
            if (string.IsNullOrEmpty(assetPath))
            {
                return(false);
            }

            if (FileAssetPaths.Contains(assetPath))
            {
                return(true);
            }

            if (FolderAssetPaths.Exists(p => p == System.IO.Path.GetDirectoryName(assetPath)))
            {
                return(true);
            }

            if (RootAssetPaths.Exists(assetPath.StartsWith))
            {
                return(true);
            }

            return(false);
        }