Rasagar/Assets/ProceduralTerrainPainter/Runtime/Modifiers/Height.cs
2024-08-26 23:07:20 +03:00

28 lines
672 B
C#

using System;
using UnityEngine;
using UnityEngine.Serialization;
namespace sc.terrain.proceduralpainter
{
[System.Serializable]
public class Height : Modifier
{
public float min = 0;
[Min(0.001f)] public float minFalloff = 1;
public float max = 2000;
[Min(0.001f)] public float maxFalloff = 1;
public void OnEnable()
{
passIndex = FilterPass.Height;
}
public override void Configure(Material material)
{
base.Configure(material);
material.SetVector("_MinMaxHeight", new Vector4(min, max, minFalloff, maxFalloff));
}
}
}