A class in Root.Township, Alta.Alchemy.
The player's EffectHandler. Adds networked teleporting: it moves the local player and shows the teleport effect for everyone nearby. Both sides; a component on the player prefab.
Constructors
| Member | What it is |
|---|
PlayerEffectController() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
3 private and internal fields
Properties
Events
| Member | What it is |
|---|
event Action<EffectHandler.TeleportType> PlayerRepositioned | Raised on the local player after the server teleports them, with the teleport type. |
Methods
| Member | What it is |
|---|
override void Teleport(Vector3 position, float strength, EffectHandler.TeleportType teleportType = 0) | Local player: teleports to the position (with a cooldown) and tells others. Server on a remote player: tells that player to teleport. |
3 private and internal methods
| Member | What it is |
|---|
private void Awake() | Finds the PlayerCharacter on the entity and waits for entity initialization. |
private void Initialize(NetworkEntity entity) | Creates the method sync used to send teleport messages once the entity is set up. |
private void NetworkTeleport(IPlayer player, Stream stream, PlayerEffectController.PlayerEffectTeleportInformation teleportInformation) | Handles a teleport message: moves the local player if told to, spawns the visual effect, and on the server relays the owner's message to nearby chunks. |