Element
A class in Root.Township, Alta.Caves.
A cave generation element asset: a map chunk display prefab chosen by how well it suits a set of attributes, plus named variables.
- Listed in World generation
- Inherits or implements
GeneralValue,ISerializationCallbackReceiver - Derived types
Element.Create,ElementDoubleValue,ElementSingleValue - Nested types
Create,SerializedVariable
Constructors
| Member | What it is |
|---|---|
Element() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
5 private and internal fields
| Member | What it is |
|---|---|
private AttributeCurveRange[] attributeWeightings | Attribute curves used by GetEfficiency to weight this element against an attribute set. |
private float curvelessEfficiency | Efficiency meant for when no curves are set. Not read by this class in this build. |
private MapChunkDisplay prefab | Backing field for Prefab, the map chunk display spawned for this element. |
private List<Element.SerializedVariable> serializedVariables | Name and value pairs Unity saves in place of the variables dictionary. |
private Dictionary<string, GeneralValue> variables | Backing field for Variables, named general values for this element. |
Properties
| Member | What it is |
|---|---|
MapChunkDisplay Prefab { get; } | The map chunk display prefab for this element. |
Dictionary<string, GeneralValue> Variables { get; } | Named values set on the element. |
Methods
| Member | What it is |
|---|---|
float GetEfficiency(AttributeSet attributes) | How well this element suits the given attributes, from its weighting curves. |
2 private and internal methods
Used in
Members of other types that take, return or hold a Element:
Biome.GetElementMultiplier, BiomeResources.elements, BiomeResources.Elements, GeneratedBiome.ElementChances, GeneratedBiome.GeneratedBiome, GeneratingBiome.elementMultipliers, IBiomeValues.ElementChances, Plugin.element, Plugin.Element, ApplyElement.element, ApplyElement.Element, ApplyElementInstance.element.