public static Texture2D EncodeAndCreateAsset(Texture2D texture2D, string path)
        {
            var bytes = texture2D.EncodeToPNG();

            File.WriteAllBytes($"{Application.dataPath}/{path}", bytes);
            return(AssetQuerying.FindAssetAtPath <Texture2D>(path));
        }
 private void Awake()
 {
     if (assetShortCuts.Count == 0)
     {
         assetShortCuts.Add(AssetQuerying.FindAssetAtPath <Object>("Resources/Global Item Index.asset"));
         assetShortCuts.Add(AssetQuerying.FindAssetAtPath <Object>("ScriptableObjects"));
         assetShortCuts.Add(AssetQuerying.FindAssetAtPath <Object>("Scripts"));
     }
     if (favouriteScenes.Count == 0)
     {
         favouriteScenes.Add(AssetQuerying.FindAssetAtPath <SceneAsset>("Scenes/PreloadScene.unity"));
         favouriteScenes.Add(AssetQuerying.FindAssetAtPath <SceneAsset>("Scenes/Art/HUB/Hub.unity"));
         favouriteScenes.Add(AssetQuerying.FindAssetAtPath <SceneAsset>("Scenes/Art/Fishing Scene.unity"));
     }
 }
        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>());
 }