Files
2026-06-22 16:18:34 +02:00

50 lines
1.7 KiB
C#

using System;
using UnityEngine;
namespace Game.WorldGen
{
public enum FeatureType
{
/// <summary>Additive cone/peak. Optional ridged roughness for a rocky look.</summary>
Mountain,
/// <summary>Flat-topped mesa: blends the terrain toward a target height with smooth edges.</summary>
Plateau,
/// <summary>Cone rising to a rim, then a central crater depression (ARK-style volcano).</summary>
Volcano
}
/// <summary>
/// A hand-placed relief feature stamped onto the procedural base in world space.
/// Because it is sampled in world space it spans tile boundaries seamlessly.
/// </summary>
[Serializable]
public class TerrainFeature
{
public string name = "Feature";
public FeatureType type = FeatureType.Mountain;
[Tooltip("World position in meters (X, Z), measured from the world origin corner.")]
public Vector2 worldPosition = new Vector2(3000f, 3000f);
[Tooltip("Radius of influence in meters.")]
public float radiusMeters = 500f;
[Range(0f, 1f), Tooltip("Peak/target height as a fraction of the world's max height.")]
public float strength01 = 0.4f;
[Range(0.5f, 5f), Tooltip("Higher = steeper, more pointed falloff.")]
public float falloffPower = 2f;
[Range(0f, 1f), Tooltip("Mountain only: amount of ridged roughness mixed into the slopes.")]
public float roughness = 0.3f;
[Range(0.05f, 0.9f), Tooltip("Volcano only: crater radius as a fraction of the feature radius.")]
public float craterRadius01 = 0.35f;
[Range(0f, 1f), Tooltip("Volcano only: crater depth below the rim, as a fraction of strength.")]
public float craterDepth01 = 0.5f;
}
}