using UnityEngine;
#if UNITY_2020_OR_NEWER || UNITY_2020_2_OR_NEWER
using UnityEditor.AssetImporters;
#else
using UnityEditor.Experimental.AssetImporters;
#endif
namespace UnityEditor.TerrainTools
{
///
/// Asset importer for noise template files. Used to detect when a noise template is imported and checks to see if the shaders need to be regenerated.
///
[ScriptedImporter(1, "noisehlsltemplate")]
internal class NoiseTemplateImporter : ScriptedImporter
{
///
/// Function that is called when an asset with the ".noisehlsltemplate" extension is imported by the AssetDatabase
///
/// The context for the imported asset
public override void OnImportAsset(AssetImportContext ctx)
{
NoiseLib.GenerateHeaderFiles();
NoiseLib.GenerateShaders();
}
}
}