Skip to main content

AOEDamage

A class in Root.Township, the global namespace.

Deals one burst of area damage when it starts, to every health object in a sphere. Damage is applied on the server and scaled by the server's DamageX setting.

Constructors​

MemberWhat it is
AOEDamage()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

4 private and internal fields
MemberWhat it is
private float damageBase damage dealt to each target.
private LayerMask damagedLayersLayers searched for targets. Each hit collider needs an ImpactDetector in its parents.
private ImpactType damageTypeImpact type set in the inspector. Not used by Start.
private float radiusRadius of the damage sphere.

Methods​

2 private and internal methods
MemberWhat it is
private void OnDrawGizmosSelected()Draws the damage sphere in the editor.
private void Start()Finds colliders in the sphere and damages each one's health target once (server only), with source AreaOfEffect.