Skip to main content

CaveTeleportSettings

A class in Root.Township, Alta.Caves.

Global settings for cave teleporters: fuel costs between layers, effects, sounds and delays. Get it with GlobalSettings<CaveTeleportSettings>.Instance.

Constructors​

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

Fields​

15 private and internal fields
MemberWhat it is
private float animationDurationLength of the teleporter repair animation, exposed as AnimationDuration.
private PooledObjectDefinition arriveAtCaveEffectPooled effect played where a player arrives in a cave layer.
private PooledObjectDefinition arriveAtSurfaceEffectPooled effect played where a player arrives on the surface.
private Material baseMaterialMaterial for the repair animation, exposed as BaseMaterial.
private PooledObjectDefinition departFromCaveEffectPooled effect played where a player leaves from a cave layer.
private PooledObjectDefinition departFromSurfaceEffectPooled effect played where a player leaves from the surface.
private AnimationCurve fadeInCurveFade-in curve for the repair animation.
private AnimationCurve fadeOutCurveFade-out curve for the repair animation.
private TeleportCostStructure fromSurfaceCost structure for teleports that start on the surface (layer 0); adds one to the layer distance.
private NetworkPrefab fuelPrefabPrefab of the fuel item that CaveTeleporter.AddAmount spawns into a teleporter's fuel dock.
private float localSoundCooldownSeconds between teleport sounds for the local player (default 4).
private float teleportDelaySeconds between starting a teleport and moving the player (default 1); the screen fades over half of it.
private SoundEffectSet teleportSoundEffectSound played on teleport.
private TeleportCostStructure toSurfaceCost structure for teleports that end on the surface; adds one to the layer distance.
private TeleportCostStructure withinCavesCost structure for teleports between two cave layers.

Properties​

MemberWhat it is
float AnimationDuration { get; }Duration of the teleporter repair animation.
Material BaseMaterial { get; }Material for the repair animation.
AnimationCurve FadeInCurve { get; }Fade in curve for the repair animation.
AnimationCurve FadeOutCurve { get; }Fade out curve for the repair animation.
NetworkPrefab FuelPrefab { get; }The fuel item prefab.
float LocalSoundCooldown { get; set; }Seconds (default 4) before the local player can hear the teleport sound again.
float TeleportDelay { get; }Seconds (default 1) between the departure effect and the player being moved. The screen fades for half of it.
SoundEffectSet TeleportSoundEffect { get; }Sound played when a player teleports.

Methods​

MemberWhat it is
static void CalculateCost(int fromLayer, int targetLayer, out int fromCost, out int toCost)Fuel cost at each end for a trip between two layers (0 is the surface). Uses the from-surface, to-surface or within-caves cost table.
static void PlayEffects(TeleportEffectArgument effectArgument)Client: spawns the arrive or depart effect for a surface or cave teleport at the given position.

Used in​

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