Skip to main content

TeleportCostStructure

A class in Root.Township, Alta.Caves.

Asset with the fuel cost formula for one kind of cave teleport (from the surface, to the surface or within caves). Picked by CaveTeleportSettings.CalculateCost.

  • Listed in World generation
  • Inherits or implements ScriptableObject
  • Attributes CreateAssetMenu

Constructors​

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

Fields​

5 private and internal fields
MemberWhat it is
private int baseCostFuel cost before distance. Default 5.
private int distanceCorrectionLayer distance per cost step (integer division). Default 10.
private float fromMultiplierScales the cost paid at the teleporter you leave from.
private int layerDistanceIncreaseExtra cost per distance step.
private float toMultiplierScales the fuel taken from the destination layer's teleporter.

Methods​

MemberWhat it is
void CalculateCost(int distance, out int fromCost, out int toCost)Cost is baseCost plus layerDistanceIncrease for every distanceCorrection layers, times the from and to multipliers, rounded.

Used in​

Members of other types that take, return or hold a TeleportCostStructure: