public static IEnumerable <ResourcesAssetEntry> GetScriptableObjectsWithInterface(Type @interface) { foreach (var so in Util.GetAssets <ScriptableObject>()) { if (so != null && @interface.IsAssignableFrom(so.GetType())) { yield return(ResourcesAssetEntry.Create(so)); } } }
public static IEnumerable <ResourcesAssetEntry> GetPrefabsWithComponent(Type component) { foreach (var go in Util.GetAssets <GameObject>()) { if (go != null && go.GetComponent(component) != null) { yield return(ResourcesAssetEntry.Create(go)); } } }
internal static IEnumerable <ResourcesAssetEntry> GetAssets(Type type) { Util.EnsureProjectFolderExists(RESOURCES_ROOT_FOLDER); if (typeof(Component).IsAssignableFrom(type)) { foreach (var asset in Util.GetAssets(typeof(GameObject), "", RESOURCES_ROOT_FOLDER)) { var go = asset as GameObject; if (go && go.GetComponent(type)) { yield return(ResourcesAssetEntry.Create(asset)); } } } else { foreach (var asset in Util.GetAssets(type, "", RESOURCES_ROOT_FOLDER)) { yield return(ResourcesAssetEntry.Create(asset)); } } }