using UnityEngine; using System.Collections; using System.Collections.Generic; namespace Gaia { public enum BorderMaskStyle {ImageMask, DistanceMask, None} /// /// Stores the settings for how often and at which size etc. a stamp from a certain feature (=stamp directory) appears /// /// [System.Serializable] public class StampFeatureSettings { /// /// The stamp directory name where stamps for this feature will be pulled from /// public string m_featureType; /// /// The influence setting for the stamp. /// public ImageMaskInfluence m_stampInfluence = ImageMaskInfluence.Global; /// /// The secondary mask used in the stamp to blend the stamp borders with the terrain. /// public BorderMaskStyle m_borderMaskStyle; /// /// The directory name where stamps for the secondary image mask will be pulled from /// public string m_borderMaskType = "Masks"; /// /// The operation to perform for this stamp /// public GaiaConstants.TerrainGeneratorFeatureOperation m_operation = GaiaConstants.TerrainGeneratorFeatureOperation.RaiseHeight; /// /// only used internally to calculate the spawn chances during spawning /// public float m_stackedChance; /// /// The minimum width of the stamp /// public float m_minWidth = 50f; /// /// The maximum width of the stamp /// public float m_maxWidth = 200f; /// /// Whether the width should be tied to the strength of the spawn mask. If not, it will be rolled randomly. /// public bool m_tieWidthToStrength = true; /// /// The minimum height of the stamp /// public float m_minHeight = 1f; /// /// The maximum height of the stamp /// public float m_maxHeight = 5f; /// /// The minimum strength for a mix operation /// public float m_minMixStrength = 0.10f; /// /// The maximum strength for a mix operation /// public float m_maxMixStrength = 0.25f; /// /// The minimum mid point for a mix operation /// public float m_minMixMidPoint= 0.25f; /// /// The maximum mid point for a mix operation /// public float m_maxMixMidPoint = 0.75f; /// /// Whether the height should be tied to the strength of the spawn mask. If not, it will be rolled randomly. /// public bool m_tieHeightToStrength = true; /// /// The minimum height difference from the terrain surface of the stamp /// public float m_minYOffset = -1f; /// /// The maximum height difference from the terrain surface of the stamp /// public float m_maxYOffset = 1f; /// /// The chance that the stamp will be inverted /// public float m_invertChance = 0f; /// /// A mapping between the strength of the mask stack and the spawn chance - useful if you want to remap different feature types to different strengths of a mask /// public AnimationCurve m_chanceStrengthMapping = ImageMask.NewAnimCurveStraightUpwards(); /// /// Whether these settings are currently folded out in the editor or not. /// public bool m_isFoldedOut = true; private StampFeatureSettings x; public StampFeatureSettings() { } public StampFeatureSettings(StampFeatureSettings original) { GaiaUtils.CopyFields(original,this); m_chanceStrengthMapping = new AnimationCurve(original.m_chanceStrengthMapping.keys); } } /// /// Prototype for stamps and their fitness /// [System.Serializable] public class ResourceProtoStampDistribution { [Tooltip("Stamp name.")] public string m_name; [Tooltip("Feature Chances.")] public List m_featureSettings = new List(); } }