Interface IInteractable
An interface for all objects that the player can interact with.
Namespace: Edgar.Unity.Examples
Assembly: cs.temp.dll.dll
Syntax
public interface IInteractable
Methods
BeginInteract()
Called once the interaction begins (i.e. this object gets the focus of the player). In our simplified scenario, this happens when the player enters the collider of this object.
Declaration
void BeginInteract()
EndInteract()
Called once the interaction ends (i.e. this object loses the focus of the player). In our simplified scenario, this happens when the player exits the collider of this object, when IsInteractionAllowed returns false or when a different object gets into focus.
Declaration
void EndInteract()
Interact()
Called during each frame when the this object is the focus of the player.
Declaration
void Interact()
IsInteractionAllowed()
Used to check whether the object wants to interact with the player.
Declaration
bool IsInteractionAllowed()
Returns
Type | Description |
---|---|
System.Boolean |