using System.Collections.Generic;
using System.Linq;
using UnityEditor;

namespace Assets.Source.Editor.Utils
{
    public class ProjectSurfer : ScriptableWizard
    {
        //public Material AlphaBlended;
        //public Material Additive;

        [MenuItem("Tools/Surf")]
        public static void Surf()
        {
            DisplayWizard<ProjectSurfer>("ProjectSurfer", "Surf");
        }

        public static List<T> FindAssetsByType<T>() where T : UnityEngine.Object
        {
            var guids = AssetDatabase.FindAssets($"t:{typeof(T)}");
            return
                guids.Select(AssetDatabase.GUIDToAssetPath)
                    .Select(AssetDatabase.LoadAssetAtPath<T>)
                    .Where(asset => asset != null)
                    .ToList();
        }
        
        // When the user presses the "Apply" button OnWizardOtherButton is called.
        void OnWizardCreate()
        {
            //EditorUtility.SetDirty();
            //AssetDatabase.SaveAssets();
        }
    }
}

