ChunkEnvironment
A class in Root.Township, Alta.Chunks.
Per-chunk environment settings on a LocationChunk: ambient temperature override, atmosphere override, terrain collision and the biome used for spawning.
- Listed in World, chunks and saving
Constructors
| Member | What it is |
|---|---|
ChunkEnvironment() | Creates a ChunkEnvironment with default values. |
Fields
8 private and internal fields
| Member | What it is |
|---|---|
private float ambientTemperature | Backing field for AmbientTemperature (default 23). Only shown in the inspector when the override is on. |
private SerializedGeneratedBiome biome | Serialized biome that SpawnData is generated from when no procedural data was set. |
private GeneratedBiome generatedBiome | Biome generated from biome the first time SpawnData is read. |
private SpawnData generationContext | Cached SpawnData, either set by SetProcedural or built from the serialized biome. |
private bool isDisablingTerrainCollision | Backing field for IsDisablingTerrainCollision. |
private bool isOnlyUsingOwnedPointers | Backing field for IsOnlyUsingOwnedPointers. |
private bool overridesAmbientTemperature | Backing field for OverridesAmbientTemperature; set to true whenever AmbientTemperature is assigned. |
private AtmosphereSet overrideSet | Backing field for OverrideSet (the chunk's atmosphere override). |
Properties
| Member | What it is |
|---|---|
float AmbientTemperature { get; set; } | The chunk's ambient temperature (default 23). Setting it also turns the override on. |
GeneratedBiome Biome { get; } | The generated biome from SpawnData. |
BasicEcosystem Ecosystem { get; private set; } | The ecosystem set when the chunk was initialized. |
bool IsDisablingTerrainCollision { get; } | When set, pickups entering this chunk stop colliding with the main terrain. |
bool IsOnlyUsingOwnedPointers { get; } | A serialized flag with no reader in this build. |
bool OverridesAmbientTemperature { get; } | True when this chunk replaces the normal ambient temperature, read by AmbientTemperatureChecker. |
AtmosphereSet OverrideSet { get; set; } | Atmosphere set that replaces the normal atmosphere (and audio aux bus) while the local player is in the chunk. |
SpawnData SpawnData { get; } | Spawn context for things generated in this chunk. Built from the serialized biome on first use unless set procedurally. |
Methods
| Member | What it is |
|---|---|
void Initialize(LocationChunk chunk, BasicEcosystem ecosystem) | Stores the chunk's ecosystem. |
bool IsAmbient(float temperature) | True when a temperature is within 0.1 of the chunk's ambient temperature. |
void SetProcedural(SpawnData spawnData) | Replaces the spawn data, used by procedural cave generation. |
Used in
Members of other types that take, return or hold a ChunkEnvironment: