Add Scenes to use as Environments
Unity Forma has several tools that configurator creators can use to stage and reposition your product for consumers.
Before you can use Forma to position and stage a product, you need to add the Scenes that they will use as Environments to your Unity Forma project. Any Scene that doesn't have a Configurator GameObject can be used as an Environment.
You can add Scenes to use as Unity Forma Environments from the Editor.
Set up a simple environment
To set up a new Environment that configurator creators can use in the Unity Forma interface, follow these steps:
- In the Unity Forma interface, select Forma > Staging > Environment Item.
- In the hierarchy, the system creates the Asset under Assets > Configurator > Environments.
- To load the Scene, the system uses the Commands Prefab. Create an empty GameObject in the hierarchy and then add a StagingItemCommandSettings component.
- Under Enter Commands, add a LoadScenesCommandAsync and a FadeScreenshotCommand.
- Under Exit Commands, add a ScreenshotCommand and a LoadScenesCommandAsync. The commands appear in the hierarchy, the commands appear as GameObjects.
- Under enterCommands, select LoadScenesCommandAsync and drag the Scene that has the environment you want to load from the drag zone. Make sure that the Load option is enabled.
- Under exitCommands, select the LoadScenesCommandAsync and then select Populate from Enter Commands. Make sure that the Load option is disabled.
You can use the FadeScreenshot and Screenshot commands are intended to help the configurator transition between Scenes. - Drag and drop the root in the Project window to create a Prefab, and then delete it from the hierarchy.
- On the Prefab command GameObject from the Project window, link it to the Environment item you created in the Staging Item Settings.
On the environment item, link the Prefab command. You an also add a thumbnail and change the display name.
The Unity Forma interface shows your product in the Environment you added:If the Environment you added doesn't appear in the Environments tab automatically, select +Add to add it manually.
To prepare more complex Scenes, or to add a Unity Scene as an Environment, follow the instructions in the Profiles section.
Staging tips
Use these features to improve the appearance of your product in the Environments you add.
Set up the splashscreen
When you setup the stage transition loading screen, you can set up the splashscreen that appears in your configurator. To set up the splashscreen, follow these steps:
- On the Configurator GameObject, scroll to find the Splashscreen Prefab in the Configurator component.
- In the Inspector tab, in the row for Splashscreen Prefab, select the Select GameObject button and then select the Splashscreen prefab. The splashscreen appears when you open the exported configurator.
To modify the splashscreen, open the Prefab and make the necessary modifications.
Set up smooth transitions between environments
You can use the FadeScreenshotCommand and the ScreenshotCommand under the Environment Prefab commands.
Staging Command Prefab
Environment loading and unloading in Forma is controlled through a Command Prefab. This GameObject is found in the Scene hierarchy as a top-level GameObject called Configurator_Commands. Each staging item (environment, cameras, animation) has a Staging Item Command Setting component and is a child GameObject called StagingItemName_Command under the Configurator_Commands GameObject.
Each Staging Item Command Setting GameObject has the following children:
enterCommands GameObject. Parent object to all the enter staging commands for this item.exitCommands GameObject. Parent object to all the exit staging commands for this item.settings
When an Environment is loaded, the system runs all the commands in the list for Enter Command on the Staging Item Command Setting component. When an Environment is unloaded, the system runs all the commands in the Exit Commands. When an Environment is unloaded in place of a new Environment, the command order is as follows: 1) All exit commands from the Environment to be unloaded; 2) All enter commands from the Environment to be loaded.
You can find a full list of all commands that come with Unity Forma in the Command Class Documentation. Custom commands can be created by inheriting the Command class.