A class in Root.Township, Alta.Impact.
A trigger that swaps itself for another prefab when hit hard enough by a matching impact tool, like cutting a plant. The server spawns the new prefab and destroys this entity; clients play the effect.
Constructors
| Member | What it is |
|---|
CutableObject() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
5 private and internal fields
| Member | What it is |
|---|
private PooledObjectDefinition effect | Pooled effect played at the spawn point, facing away from the hit. |
private NetworkEntity entity | The entity destroyed when cut. |
private NetworkPrefab prefabToSpawnOnHit | Prefab the server spawns in place of this object, with a random rotation. |
private Transform spawningPoint | Where the effect plays and the new prefab spawns. |
private Vector3 spawnVelocity | Velocity given to the spawned object's rigidbody. |
Methods
| Member | What it is |
|---|
protected override void HitEffect(ContactPointStructure contact) | Plays the hit effect off headless, then on the server spawns prefabToSpawnOnHit with spawnVelocity and destroys this entity. |