docs.unity3d.com
HMI Package Beta 0.1
    Show / Hide Table of Contents

    Generic scripts

    The template includes the following generic scripts that you can use.

    Escape to Quit Application Script

    This script lets users quit the application of the build when the user presses Escape.

    Controls Manager Script

    The Controls Manager script lets users listen for keypresses assigned to their Vehicle Controls Data.

    To set up the Controls Manager script, follow these steps:

    1. Assign your controls data object.
    2. Press the Refresh Key Press Events button after you have assigned a controls data or if controls data object has changed. This will update the dropdown menu in each of your KeyPressEvents list items.
    3. Add items to your Key Press Events list:
    • Select from the dropdown the event you are listening to. These events have been setup in the ControlsData object.
    • Add any other actions you want to trigger when this event is triggered.

    Display Initialization Script

    This script launches when a user opens a scene on build and initializes the display it is launched using the user selected data. Assigning the Main camera, and the canvases in scene will assign them to target display 1 in the case that this is not a multi display build.

    Check Main Camera Script

    This script should be attached to all cameras in a scene that aren't the main camera, and will look at the main camera. This will change the attached gameobject cameras Viewport rect and target display to match that of the target main camera's target display and viewport rect. This is used in Multi display and split screen scenes. The key value of this script is that the user can set up their scenes for the multiscreen build, and from the changes in the multiscreen build and one runtime per scene builds will be able to modify the target display and viewport rect of the main display and this script will update the camera that its attached to in order to match.

    Toggle Button Sprite Swap On Off Script

    This script is used as an addition to a toggle on an image. When the toggle.isOn is true then it will change the image to the sprite assigned to the ToggleOnSprite. When the toggle.isOn is false then it will change the image to the sprite assigned to ToggleOffSprite.

    Sprite Cycling Script

    This script is used to cycle sprites based on an index or string to a target image.

    • Improve this Doc
    Back to top Copyright © 2020 Unity Technologies
    Generated by DocFX