Step 2 - ADAS

In this step, you create the ADAS functionality.

../_images/preview-adas-cross-blend.gif

Create ADAS view with cross-fade transition

To create the ADAS view with cross-fade transition:

  1. In the Node Tree, in the Cluster Components, delete the ADAS with more vars node.

    In this procedure, you create the replacement content.

    ../_images/node-tree-adas-with-more-vars-removed.png
  2. In the Cluster Components node, create an Empty Node 2D, and name it ADAS_View. In the Properties, add and set:

    • Layout Width to 946

    • Layout Height to 480

    • Render Transformation property fields

      • Translate X to 487

      • Translate Y to 202

    You use the values for the layout size and transformation from the Figma design.

    ../_images/node-tree-adas-view.png ../_images/adas-properties.png
  3. In the Library, create a State Manager and name it ADAS State Manager:

    • Select the State Group and in the Properties:

      • Set the Controller Property to isActive

      • Under the State Transitions property, click Add transition and set:

        • Duration to 300 ms

        • Easing Function to Cubic

        • Easing Mode to Ease in-out

      ../_images/properties-adas-view-state-group.png ../_images/state-transition-settings-adas-view.png
    • Rename the states to Active and Inactive, and in each add and set:

      • Active state:

        • isActive to enabled

        • Node > Opacity to 1

      • Inactive state:

        • isActive to disabled

        • Node > Opacity to 0

      ../_images/properties-adas-state-manager-active.png ../_images/properties-adas-state-manager-inactive.png ../_images/library-adas-state-manager.png
  4. From the Prefabs, drag the ADAS with more vars prefabs to the ADAS View.

    ../_images/node-tree-adas-view-with-adas-prefabs.png
  5. In the Properties, for each ADAS with more vars prefab instance add and set:

    • Resources > State Manager to ADAS State Manager

    • 04 Center Control > ADAS_Control to its ADAS view:

      • Default prefab instance to ADAS_01

      • Step 01 prefab instance to ADAS_02

      • Step 02 prefab instance to ADAS_03

      • Step 03 prefab instance to ADAS_04

    ../_images/node-tree-adas-view-adas-with-more-vars-default.png ../_images/properties-adas-view-adas-with-more-vars-default.png
  6. For each ADAS with more vars prefab instance, in the Properties click Add Binding, and bind:

    • Visible property to

      CEIL({@./Node.Opacity})
      

      When Opacity is 0, this binding sets the Visible property to false. This way the node is not rendered when not active.

      ../_images/binding-adas-visible.png
    • isActive property to

      {@./Control.ADAS_Control} == {@../Control.ADAS_Control}
      
      ../_images/binding-adas-isActive.png
  7. In the ADAS_View node, create a binding to control the ADAS views from the Control node. Bind the ADAS Control property to the same property in the Control node.

    {#Control/Control.ADAS_Control}
    
    ../_images/binding-adas-control.png

After you restart the Preview, you can set the ADAS view in the Control node using the ADAS Control property.

../_images/node-tree-control.png ../_images/properties-adas-control.png ../_images/preview-adas-cross-blend.gif

Control collision warning

The ADAS view 02 (ADAS_02) contains a collision warning message. In this section, you adjust the project to control the visibility of the collision warning message with a property.

../_images/preview-collision-warning.png

To control the collision warning:

  1. In the Library, create a State Manager and name it Collision Warning State Manager:

    • Select the State Group and in the Properties:

      • Set the Controller Property to Collision Warning

      • Under the State Transitions property, click Add transition and set:

        • Duration to 300 ms

        • Easing Function to Cubic

        • Easing Mode to Ease in-out

      ../_images/properties-collision-warning-state-group.png ../_images/state-transition-settings-adas-view.png
    • Rename the states to Active and Inactive, and in each add and set:

      • Active state:

        • CollisionWarning to enabled

        • Node > Opacity to 1

        • Transform 2D > Render Transformation property field Translation Y to 0

      • Inactive state:

        • CollisionWarning to disabled

        • Node > Opacity to 0

        • Transform 2D > Render Transformation property field Translation Y to 100

      ../_images/properties-collision-warning-state-manager-active.png ../_images/properties-collision-warning-state-manager-inactive.png ../_images/library-collision-warning-state-manager.png
  2. In the Node Tree, select the Cluster Components > ADAS_View > ADAS with more vars | Property 1=ACC Step 01_2386:1077 > Property 1=ACC Step 01 > CollisionWarning node.

    ../_images/node-tree-collision-warning.png
  3. In the Properties:

    • Click Add Binding and bind:

      • Visible property to

        CEIL({@./Node.Opacity})
        

        When Opacity is 0, this binding sets the Visible property to false. This way the node is not rendered when not active.

        ../_images/binding-collision-visible.png
      • isActive property to

        {#Control/Control.ADAS_CollisionWarning}
        
        ../_images/binding-collision-control.png
    • Set the State Manager property to Collision Warning State Manager.

You can now control the collision warning in the Control node. The collision warning is shown when:

  • ADAS Control is set to ADAS_02

  • Collision Warning is set to enabled

../_images/node-tree-control.png ../_images/properties-collision-warning-control.png ../_images/preview-collision-warning.gif