コード例 #1
0
        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);
        }
コード例 #2
0
        static public bool IsInternalAsset(this AssetInfo item)
        {
            if (Filename.ArePathsEquivalent(item.GetDirectory(), Project.GetInternalAssetDirectory()))
            {
                return(true);
            }

            return(false);
        }
コード例 #3
0
        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>());
        }
コード例 #4
0
 static public IEnumerable <AssetInfo> GetInternalAssetInfos(Type type)
 {
     return(GetAssetInfos("", Project.GetInternalAssetDirectory(), type)
            .Narrow(a => a.IsInternalAsset()));
 }