Skip to main content

GeneralSettings

A class in Root.Township, Alta.Caves.

Cave settings asset with the seed, top entrance and layer prefab. Loaded through CaveSettings<GeneralSettings>.Instance.

Constructors​

MemberWhat it is
GeneralSettings()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

6 private and internal fields
MemberWhat it is
private int chunkSizeLayer chunk size. Marked as not used.
private float heightSeparationBacking field for HeightSeparation.
private NetworkPrefab layerPrefabBacking field for LayerPrefab.
private float millisecondAllowanceBacking field for MillisecondAllowance.
private int seedBacking field for Seed.
private Vector2 topOpeningBacking field for TopOpening.

Properties​

MemberWhat it is
float HeightSeparation { get; }Depth between cave layers, used for layers past the stored depth list.
NetworkPrefab LayerPrefab { get; }Network prefab spawned for cave layers by CaveLayerStreamer.
float MillisecondAllowance { get; }Time budget per frame for cave generation rendering work, minus the frame's own time.
int Seed { get; }Fixed cave seed. -1 (the default) means a random seed, which also clears the caves save.
Vector2 TopEntranceDirection { get; }Direction of the top cave entrance. Always (0, -1).
Vector2 TopOpening { get; }Position of the top cave entrance on layer 0, used when no entrances are set yet.