Skip to main content

GetInteractionPlayer

A class in Root.Township, the global namespace.

Passes the player who starts or stops using an interactable on to player events.

Constructors​

MemberWhat it is
GetInteractionPlayer()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

3 private and internal fields
MemberWhat it is
private Interactable interactableInteractable watched.
private PlayerEvent interactionEndedEvent fired with the player when they stop interacting.
private PlayerEvent interactionStartedEvent fired with the player when they start interacting.

Methods​

3 private and internal methods
MemberWhat it is
private void Awake()Hooks the interactable's start and end events.
private void Ended(Interactable interactable, Interactor interactor)Fires interactionEnded with the interactor's player.
private void Started(Interactable interactable, Interactor interactor)Fires interactionStarted with the interactor's player.