static public CustomAsset CreateInternalCustomAsset(Type type, Process <CustomAsset> process) { CustomAsset asset = ScriptableObject.CreateInstance(type) as CustomAsset; process(asset); asset.SaveNewAsset(Filename.MakeUnusedFilename(Project.GetInternalAssetDirectory(), "asset")); return(asset); }
static public bool IsInternalAsset(this AssetInfo item) { if (Filename.ArePathsEquivalent(item.GetDirectory(), Project.GetInternalAssetDirectory())) { return(true); } return(false); }
static public IEnumerable <string> GetExternalCustomAssetPathsOfType(Type type) { if (type.CanBeTreatedAs <CustomAsset>()) { return(AssetDatabase.FindAssets("t:" + type.Name) .Convert(g => AssetDatabase.GUIDToAssetPath(g)) .Skip(p => p.StartsWith(Project.GetInternalAssetDirectory()))); } return(Empty.IEnumerable <string>()); }
static public IEnumerable <AssetInfo> GetInternalAssetInfos(Type type) { return(GetAssetInfos("", Project.GetInternalAssetDirectory(), type) .Narrow(a => a.IsInternalAsset())); }