LocalPlayerInteractionEvents
A class in Root.Township, the global namespace.
Fires Unity events when the local player starts or stops using an Interactable. Other players' interactions are ignored. Client.
Constructors
| Member | What it is |
|---|
LocalPlayerInteractionEvents() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
5 private and internal fields
| Member | What it is |
|---|
private InteractableEvent firstInteractionStarted | Event fired when the local player is the first to grab it. |
private Interactable interactable | The interactable being watched. |
private InteractableEvent interactionEnded | Event fired whenever the local player lets go. |
private InteractableEvent interactionStarted | Event fired whenever the local player grabs it. |
private InteractableEvent lastInteractionEnded | Event fired when the local player lets go and no one else holds it. |
Methods
3 private and internal methods
| Member | What it is |
|---|
private void Awake() | Subscribes to the interactable's start and end events. |
private void InteractionEnded(Interactable interactable, Interactor interactor) | For the local player, fires interactionEnded, and lastInteractionEnded if nobody is still interacting. |
private void InteractionStarted(Interactable interactable, Interactor interactor) | For the local player, fires interactionStarted, and firstInteractionStarted if it is the only interactor. |