Пример #1
0
        public IEnumerable <AssetInfo> GetAssetInfos(string assetPath)
        {
            var assetInfos = new List <AssetInfo>();

            var assetPaths = new string[0];

            if (AssetDatabase.IsValidFolder(assetPath))
            {
                assetPaths = UnityEditorUtility.GetAllAssetPathInFolder(assetPath);
            }
            else
            {
                assetPaths = new string[] { assetPath };
            }

            foreach (var path in assetPaths)
            {
                var assetInfo = GetAssetInfo(path);

                if (assetInfo != null)
                {
                    assetInfos.Add(assetInfo);
                }
            }

            return(assetInfos);
        }
Пример #2
0
        public string[] GetManageAssetPaths(ManageInfo manageInfo)
        {
            var assetPath = AssetDatabase.GUIDToAssetPath(manageInfo.guid);

            if (!AssetDatabase.IsValidFolder(assetPath))
            {
                return(new string[] { assetPath });
            }

            var assetPaths = UnityEditorUtility.GetAllAssetPathInFolder(assetPath);

            return(assetPaths.Where(x => !IsIgnoreManageAsset(x)).ToArray());
        }