Auto Registerable Data Asset
The auto-registering system in Skyreal VR allows you to create your own custom extension points that are automatically discovered and loaded.
How to Create a New Extension Point
-
Create a new extension plugin (e.g.,
SkrBaseExtensionPlugin). -
Create a new blueprint that inherits from PrimaryDataAsset (e.g.,
BP_ExtensionBaseAsset).
[IMAGE: Create blueprint — original at /pictures/v1.16/Extensions_CreateBP.png]
[IMAGE: Inherit from PrimaryDataAsset — original at /pictures/v1.16/Extensions_CreatePrimaryDataAsset.png]
-
Implement the interface SkrAutoRegisteringAsset.
[IMAGE: Implement interface — original at /pictures/v1.16/Extensions_ImplementInterface0.png]
-
Fill the method GetShouldAutoRegisterAsset with a custom boolean variable.
[IMAGE: Implement GetShouldAutoRegisterAsset — original at /pictures/v1.16/Extensions_ImplementInterface1.png]
-
Add any variables to the blueprint that should be accessible in the extensions you want to create.
[IMAGE: Variable definition examples — original at /pictures/v1.16/Extensions_VariableSamples.png]
How to Retrieve All Extension Data Assets
To retrieve all assets that extend your PrimaryDataAsset:
-
Get the SkrRegistrySubSystem.
-
(Optional) Bind to FSkrRegisteredDataAssetsAddedEvent and FSkrRegisteredDataAssetsRemovedEvent for dynamic reloading.
-
Call GetRegisteredDataAsset and specify the base class type.
[IMAGE: Retrieve registered data assets in blueprints — original at /pictures/v1.16/Extensions_GetAssets.png]
How to Create an Extension
-
Create a new extension plugin (e.g.,
SkrExtensionExtensionPlugin) with aRegistrableAssetsdirectory. -
Create a new DataAsset that inherits from your PrimaryDataAsset blueprint.
[IMAGE: Create extension data asset — original at /pictures/v1.16/Extensions_CreateDataAssetExtension.png]
-
Fill the data asset with your properties.
[IMAGE: Fill data asset properties — original at /pictures/v1.16/Extensions_CompleteDataAssetExtension.png]
Important: During a Skyreal VR session, import the base extension plugin before other extension plugins that depend on it.