Presets offer a quick, easy, data-driven way to change settings on the fly. These assets are created in the editor and applied at run-time using the ApplyPreset(TunnellingPreset p) method.
By creating a number of presets, you can give your users the ability to easily change comfort settings through an options menu. Offering these options to users (including the option to disable tunnelling) is strongly recommended as different users respond to different solutions.
TIP: Best practice is to offer users presets, but also allow them to change individual settings if desired. This lets users quickly find the right "ballpark" with presets, then tweak details.
To create a preset, right-click in the Project pane, and select:
Create > VR Tunnelling Pro > Tunnelling Preset
or
Create > VR Tunnelling Pro > Tunnelling Mobile Preset.
This creates an asset you can edit. To reference in a script, make a field such as public TunnellingPreset myPreset
and you can then drag the preset asset into the field in the editor.
TIP: Both Tunnelling and TunnellingOpaque can use the same TunnellingPreset assets, but TunnellingMobile must use TunnellingPresetMobile assets.
Settings on a Preset asset match those on the Tunnelling script but are all shown at once regardless of modes. This can be overwhelming but allows full, detailed control for advanced users.
Additionally, each parameter has an associated tickbox in the Override column. Only parameters with this ticked will be used. All others are ignored - they retain whatever setting was active on the Tunnelling script at the time. Don't forget to tick override on the settings you want changed!
Ticking the All box makes all parameters active but won't overwrite the individual checkboxes - you can restore them just by unticking All.
TIP: You can use selective overrides to make partial presets - for example, users can change motion settings separately from skybox settings.