Environments
Skyreal VR introduce a new kind of environment since version 1.15 that is based on level layering and allow to easily integrate behaviour using parameters.
Create a new environement
To create a new environment extension:
- Create an new extension plugin with a RegistrableAssets directory
- Create a data asset in the RegistrableAssets directory that inherits from Skr3DEnvironmentPreset
- Fill Preset Name and Thumbnail field and make sure Auto Register Preset is checked
- Create a Data Asset in your extension plugin (NOT in the RegistrableAssets directory) that inherits from Skr3DEnvironmentLayer and reference it into the Layers array field of your previously created data asset.
- Fill the Name and Description field of the layer data asset
- Create a Level in your extension plugin and add it into the Level field of the layer data asset.
- Create your own environment level.
Important information: Skyreal VR defaults maps already has lights and skybox, so if you need specific, you can paste following code in the level blueprint:
Add behaviour params
Environments came with a param system that provide an easy way to change the environment based on user interface automatically build on the right panel. To do so:
- Create a Data Asset in your extension plugin (NOT in the RegistrableAssets directory) that inherits from Skr3DEnvironmentParamDesc... (following by your param type)
- Fill every informations of the data asset
- Create a Data Asset in your extension plugin (NOT in the RegistrableAssets directory) that inherits from Skr3DEnvironmentParamValue... (following by your param type)
- Fill the Associated Param with the description you created just before
- Fill the default value
- In the Layer data asset, reference the Value data asset into the Override Params array field
At this step, the param has been associated to your level and will be automatically displayed in the UI. If you need to override the param in the preset, it's also possible to do so with another value data asset referencing the same description.
To Get an event when the value of the param changes, you can write this code: