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.
- Listed in World generation
- Inherits or implements
GlobalSettings<CaveTeleportSettings> - Derived types
CaveTeleportSettings - Attributes
CreateAssetMenu,GlobalSettings - Documented in Caves
Constructors
| Member | What it is |
|---|---|
CaveTeleportSettings() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
15 private and internal fields
| Member | What it is |
|---|---|
private float animationDuration | Length of the teleporter repair animation, exposed as AnimationDuration. |
private PooledObjectDefinition arriveAtCaveEffect | Pooled effect played where a player arrives in a cave layer. |
private PooledObjectDefinition arriveAtSurfaceEffect | Pooled effect played where a player arrives on the surface. |
private Material baseMaterial | Material for the repair animation, exposed as BaseMaterial. |
private PooledObjectDefinition departFromCaveEffect | Pooled effect played where a player leaves from a cave layer. |
private PooledObjectDefinition departFromSurfaceEffect | Pooled effect played where a player leaves from the surface. |
private AnimationCurve fadeInCurve | Fade-in curve for the repair animation. |
private AnimationCurve fadeOutCurve | Fade-out curve for the repair animation. |
private TeleportCostStructure fromSurface | Cost structure for teleports that start on the surface (layer 0); adds one to the layer distance. |
private NetworkPrefab fuelPrefab | Prefab of the fuel item that CaveTeleporter.AddAmount spawns into a teleporter's fuel dock. |
private float localSoundCooldown | Seconds between teleport sounds for the local player (default 4). |
private float teleportDelay | Seconds between starting a teleport and moving the player (default 1); the screen fades over half of it. |
private SoundEffectSet teleportSoundEffect | Sound played on teleport. |
private TeleportCostStructure toSurface | Cost structure for teleports that end on the surface; adds one to the layer distance. |
private TeleportCostStructure withinCaves | Cost structure for teleports between two cave layers. |
Properties
| Member | What 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
| Member | What 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: