A class in Root.Township, Alta.Carpentry.
Something a chisel can carve. Passes chisel hits on to events; subclasses decide direction rules.
Constructors
| Member | What it is |
|---|
Chiselable() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
1 private and internal field
| Member | What it is |
|---|
private FloatEvent tookDamage | Event raised with the damage whenever a chisel hits this. |
Properties
| Member | What it is |
|---|
virtual bool IsEnabled { get; set; } | Whether chisels can hit it right now. |
virtual bool TriggerHaptics { get; } | Whether a chisel near it vibrates the controller. False by default. |
Events
| Member | What it is |
|---|
event ChiselHit onHit | Raised on every chisel hit with damage, position, direction, tool and collider. |
Methods
| Member | What it is |
|---|
static IChiselable GetChiseleable(Collider collider) | Finds the chiselable on a collider or its attached rigidbody, or null. |
virtual void GetDirectionLeniency(ref float directionMultiplier) | Subclass: can adjust the direction multiplier. Does nothing by default. |
virtual float GetHitMultiplier(Vector3 hitDirection) | How well a hit direction lines up, from 0 to 1. Always 1 by default. |
virtual void ReceiveDamage(float damage, Vector3 position, Vector3 direction, ChiselingTool tool, Collider hitCollider) | Takes a chisel hit and raises the damage and hit events. |
Used in
Members of other types that take, return or hold a Chiselable: