Scripts
The IVI scene includes multiple custom scripts.
Screen Navigation scripts
The Screen Navigation script lets users set a starting IVI screen, call additional actions on screen orientation changes, and set up screen-to-screen parameters.
The Screen Navigation script includes the following public method:
- NavigateToSpecificScreen(GameObject DesiredScreen)
This method navigates to the screen you want. On navigation, it invokes all additional actions with transitioning to that GameObject.
Subscreen Navigation script
This script is an extended version of the ScriptNavigation script. It has extra functions for managing and transitioning between sub-screens.
HMI_WidgetGroup script
Every GameObject parent in the MyScreensList of the screen/subscreen navigation requires this script. This script controls the individual transitions between groups of objects from one HMI_WidgetGroup to another. These objects must have a RectTransform and CanvasGroup component.
To function, the script interpolates between the stored values of each RectTransform via Index order (unless a matching widget name is found in the target group of widgets).
You can use a bool on individual widgets to ignore CanvasGroup Alpha and Interpolation.
The script functions best when you have different parent objects for Landscape and Portrait groups.
ScreenOrientationHelper script
The script lets the user setup landsscape and portrait settings for objects in the scene. For Canvas/RectTransform GameObjects that are outside of the Screen Navigation hierarchy:
- Values for RectTransform objects placed into arrays are saved at the time of entry. They do not change unless they are overwritten.
- Deleting a GameObject from the array clears the saved data.
Render Texture setup
To reduce aliasing, the 3D vehicle and the environment in the IVI scene is displayed using a render texture.
This script requires a camera and raw image GameObject on the canvas to be assigned to it. It generates a render texture at runtime, sources the texture data from the camera, and assigns it to the raw image.