EruptAreaAttack
A class in Root.Township, the global namespace.
Networked creature attack that makes an object erupt from the ground near the agent's target. The server picks the spot and syncs it to clients.
- Listed in Global namespace: E to H
- Inherits or implements
NetworkEntityBehaviour
Constructors
| Member | What it is |
|---|---|
EruptAreaAttack() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
15 private and internal fields
| Member | What it is |
|---|---|
private Agent agent | Agent whose target is attacked; it must be alive. |
private Animator[] animators | Animators that get the trigger. |
private MethodSync attack | Method sync for the attack. |
private AltaCoroutine attacking | The running hide timer. |
private float duration | Seconds the eruption stays visible. |
private Transform erupting | Object that is moved to the spot and shown. |
private bool isUsingNormalUp | Align the eruption to the ground normal instead of straight up. |
private float offsetFromTarget | How far short of the target the spot is placed. |
private float radius | Furthest the spot can be from the attacker. |
private float raycastLength | Length of the ground raycast. |
private LayerMask raycastMask | Layers the ground raycast hits. |
private float raycastStartAboveTargetHead | Height above the target's position where the ground raycast starts. |
private string trigger | Animator trigger name, "Attack" by default. |
private Vector3 worldPosition | Chosen eruption position, also synced. |
private Quaternion worldRotation | Chosen eruption rotation, also synced. |
Methods
6 private and internal methods
| Member | What it is |
|---|---|
private void AttackLocal() | Unparents the eruption object, places it, enables it, fires the animator triggers and starts the hide timer. |
private void AttackSync(IPlayer player, Stream stream) | Sends the position and rotation; clients play the attack when they read it. |
private void OnDisable() | Forgets the running timer. |
private void OnDrawGizmosSelected() | Empty. |
private void Rechild(NetworkEntity entity, bool isUnload) | Puts the eruption object back under this transform. |
private IEnumerator Timer() (iterator) | Waits duration, then hides the eruption object and reparents it. |