DropTarget
A class in Root.Township, the global namespace.
Snap point for one specific pickup: fades a ghost in as it gets close, then locks it in place and fires events when it is near enough and lined up.
- Listed in Global namespace: C to D
- Inherits or implements
MonoBehaviour
Constructors
| Member | What it is |
|---|---|
DropTarget() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
10 private and internal fields
| Member | What it is |
|---|---|
private Color color | Original ghost colour; its alpha is the maximum fade. |
private Pickup droppable | The pickup that can snap here; cleared once it has. |
private UnityEvent droppedDelayed | Event fired eventDelay seconds after the snap. |
private UnityEvent droppedImmediate | Event fired as soon as the pickup snaps. |
private float eventDelay | Seconds before droppedDelayed fires. |
private MeshRenderer ghost | Optional renderer that shows where the pickup goes. |
private float ghostDistance | Distance at which the ghost starts to fade in. |
private Material ghostMaterial | Instance of the ghost material whose alpha is changed. |
private float snapAngle | Largest rotation difference in degrees that still snaps. |
private float snapDistance | Distance at which the pickup snaps. |