#if UNITY_EDITOR
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEditor.ProjectWindowCallback;
using System.IO;
using UnityEngine.Assertions;
using UnityEngine.Rendering;

public static class WeatherResourcesFactory
{
    class DoCreateWeatherResProfile : EndNameEditAction
    {
        public override void Action(int instanceId, string pathName, string resourceFile)
        {
            var profile = WeatherResourcesFactory.CreateProfileAtPath(pathName);
            ProjectWindowUtil.ShowCreatedAsset(profile);
        }
    }

    [MenuItem("Assets/Create/Misc/WeatherResources")]
    public static void CreateNewProfile()
    {
        ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, ScriptableObject.CreateInstance<DoCreateWeatherResProfile>(), "WeatherResources.asset", null, null);
    }

    public static WeatherResources CreateProfileAtPath(string path)
    {
        var profile = ScriptableObject.CreateInstance<WeatherResources>();
        profile.name = Path.GetFileName(path);
        AssetDatabase.CreateAsset(profile, path);
        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();
        return profile;
    }
}
#endif