Class Teleporter
Used for teleporting an object/enemy from one place to another (with audio and particle effects too!)
Namespace: WeaverCore.Utilities
Assembly: WeaverCore.dll
Syntax
public static class Teleporter
Methods
| Edit this page View SourceTeleportEntity(GameObject, Vector3, float, float, Color, bool, bool, float)
Teleports an entity to a specified destination
Declaration
public static float TeleportEntity(GameObject entity, Vector3 Destination, float teleInTime, float teleOutTime, Color teleportColor = default, bool flashSprite = true, bool playEffects = true, float audioPitch = 1)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | entity | The entity to teleport |
| Vector3 | Destination | The destination of the entity |
| float | teleInTime | How long the entity will wait before it will teleport |
| float | teleOutTime | How long the entity will wait after it has teleported |
| Color | teleportColor | The color of the teleportation effects. If left at the default, the teleport color will be white |
| bool | flashSprite | Whether the sprite on the entity should flash or not. This only works if the entity has a UnityEngine.SpriteRenderer and a SpriteFlasher If a SpriteFlasher is not already on the entity, one will be created |
| bool | playEffects | Whether the teleportation effects should be played. |
| float | audioPitch |
Returns
| Type | Description |
|---|---|
| float | Returns the amount of time the teleportation will take. You can use this if you want to wait until the teleportation is done |
TeleportEntity(GameObject, Vector3, TeleType, Color, bool, bool, float)
Teleports an entity to a specified destination
Declaration
public static float TeleportEntity(GameObject entity, Vector3 Destination, Teleporter.TeleType teleType = TeleType.Quick, Color teleportColor = default, bool flashSprite = true, bool playEffects = true, float audioPitch = 1)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | entity | The entity to teleport |
| Vector3 | Destination | The destination of the entity |
| Teleporter.TeleType | teleType | How fast the teleportation should take |
| Color | teleportColor | The color of the teleportation effects |
| bool | flashSprite | Whether the sprite on the entity should flash or not. This only works if the entity has a UnityEngine.SpriteRenderer and a SpriteFlasher If a SpriteFlasher is not already on the entity, one will be created |
| bool | playEffects | Whether the teleportation effects should be played. |
| float | audioPitch |
Returns
| Type | Description |
|---|---|
| float | Returns the amount of time the teleportation will take. You can use this if you want to wait until the teleportation is done |