CaveTeleporterReplacer
A class in Root.Township, the global namespace.
A GenericReplacer for cave teleporters that plays a dissolve animation from the old object to the new one before finishing the swap. The server sends the effect to clients in the chunk.
- Listed in Global namespace: C to D
- Inherits or implements
GenericReplacer
Constructors
| Member | What it is |
|---|---|
CaveTeleporterReplacer() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
8 private and internal fields
| Member | What it is |
|---|---|
private float animationDuration | Serialized but not used; the animation reads its timing from CaveTeleportSettings. |
private Material baseMaterial | Serialized but not used; the animation material comes from CaveTeleportSettings. |
private AnimationCurve fadeInCurve | Serialized but not used; the fade-in curve comes from CaveTeleportSettings. |
private AnimationCurve fadeOutCurve | Serialized but not used; the fade-out curve comes from CaveTeleportSettings. |
private bool isImmediate | True only during ReplaceImmediate, so OnReplace skips the animation. |
private TransformEvent OnAnimationStart | Event fired on clients (not headless) when the replace animation begins, with this transform. |
private RendererGroup renderers | Renderers of the old object that fade out. |
private MethodSyncStruct<uint> syncEffect | Sync message carrying the replacing entity's id. |
Methods
| Member | What it is |
|---|---|
override void Initialize() | Sets up the sync message used to send the replace effect. |
void ReplaceImmediate() | Replaces straight away with no animation or sync. |
protected override void OnReplace(NetworkEntity replacing) | Unless immediate, the server tells clients which entity replaces this one, then the swap finishes after the animation. |