Class InteractEvent
[RequireComponent(typeof(Collider))]
public class InteractEvent : MonoBehaviour, IInteractable, IInteractableBase<FirstPersonController>
- Inheritance
-
objectObjectComponentBehaviourMonoBehaviourInteractEvent
- Implements
-
IInteractableBase<FirstPersonController>
Fields
OnInteractEvents
public UnityEvent OnInteractEvents
Field Value
- UnityEvent
showMessage
public string showMessage
Field Value
- string
Methods
GetTitle(FirstPersonController)
Returns the title shown when player looks at the object. Run any custom logic here to determine the title. Returning null will exclude this object from showing up.
public string GetTitle(FirstPersonController player)
Parameters
player
FirstPersonControllerReference to the interacting playerComponent
Returns
- string
Title to show when looking at object
OnInteract(FirstPersonController)
Called when player interacts with the object.
public void OnInteract(FirstPersonController player)
Parameters
player
FirstPersonControllerReference to your playerController object.