Skip to main content

CylinderImpactCollector

A class in Root.Township, the global namespace.

Impact shape asset that collects colliders inside an upright cylinder above the hit point. Used for area effects in progression and impacts.

Constructors​

MemberWhat it is
CylinderImpactCollector()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

3 private and internal fields
MemberWhat it is
private float heightCylinder height above the hit point.
private float radiusSquaredCylinder radius squared (entered as a plain radius in the inspector).
private float sphereRadiusRadius of the sphere enclosing the cylinder, used for the first overlap test.

Properties​

MemberWhat it is
override float SizeSquared { get; }The cylinder's radius squared.

Methods​

MemberWhat it is
override IEnumerable<Collider> CollectColliders(ImpactHitWithTool hit, LayerMask collectionLayer) (iterator)Overlap-sphere around the cylinder, then keeps colliders whose position is within its height and radius from the hit point.
override void DrawGizmos()Draws the bounding sphere and the cylinder.
1 private and internal method
MemberWhat it is
private void OnValidate()Recomputes sphereRadius from the radius and height.