/Scripts/Core/GrabbableEvents.cs
A core feature of VRIF is being able to respond to a variety of events thay may occur to a Grabbable object. These events can range from being picked up/ dropped, to input events, to collision.
These events are typically only called while the object is being held, or when a specific condition is met. This increases performance while also making it easy to create functionality that only occurs while holding the object.
There are two main ways of subscribing to these events : Through dragging a public method onto a Grabbable Unity Events component, or by overriding the GrabbableEvents class.
You can extend GrabbableEvents class in order to respond to all sorts of events that happen to a Grabbable. GrabbableUnityEvents utilizes this class through inheritance. This is also how many of the included prefabs are built, by either responding to Grabbable Events, or by extending the Grabbable class to customize behaviour.
Check out /Scripts/Components/GrabbableHaptics.cs to see how easy it is to haptics to an object when it becomes a valid pickup.
Check out /Scripts/Extras/Flashlight.cs to see for a simple example on how to turn a light on and off. Hello World!
Grabbable Unity Events provides an easy way to subscribe to events in the editor by utilizing Unity Event. These events are registered through GrabbableEvents (see below), and exposed through the editor. Simply add the GrabbableUnityEvents component to a Grabbable object, and then drag and drop in your script reference the appropriate event.
Below is a screenshot of some of the events available :