Using scriptable objects for input
In this example, we will further decouple our application from the underlying input device using a technique called scriptableobjects. These are data objects used for holding information such as game state, player preferences, or any other data that is not necessarily graphical. Scriptable objects are instantiated during runtime, much like MonoBehaviour ones, but do not live in the Hierarchy, have no Transform, nor other physics and rendering behaviors.
Note
It's useful to think of scriptable objects as data containers in your projects.
In the previous implementation, BalloonController
requires a reference to the MeMyselfEye
object to use its MyInputController
component. Although the input controller component does separate you from the underlying SDK calls, if you modify your application to use a different MeMyselfEye
(for example, from OpenVR to Daydream), you will need to find and replace all references to one MeMyselfEye
in the scene and replace them...