private void CreateAll(FishType fishType) { var rarities = AssetQuerying.FindAssetsByType <Rarity>(); foreach (var rarity in rarities) { var instance = CreateInstance <FishItem>(); instance.rarity = rarity; instance.type = fishType; instance.name = $"{rarity.name}{fishType.name}"; var directoryPath = $"{Folder}/{fishType.name}"; if (!Directory.Exists(directoryPath)) { Directory.CreateDirectory(directoryPath); } var fullPath = $"{directoryPath}/{rarity.name}{fishType.name}.asset"; if (File.Exists(fullPath)) { return; } AssetDatabase.CreateAsset(instance, fullPath); } }
private static IEnumerable <IItem> FindAllItems() { return(AssetQuerying.FindAssetsByType <ScriptableObject>().OfType <IItem>()); }