class FeatureManager(val features: List<SpatialFeature>)
// ImmersiveActivity.kt (your immersive Spatial SDK activity)
override fun registerFeatures(): List<SpatialFeature> {
return listOf(
VRFeature(),
IsdkFeature(),
PhysicsFeature())
}
// ImmersiveActivity.kt (your immersive Spatial SDK activity)
fun myHelperFunction() {
val toolkitFeature = featureManager.tryFindFeature<ToolkitFeature>()
...
}
| Name | Summary |
|---|---|
FeatureManager | constructor(features: List<SpatialFeature>) |
| Name | Summary |
|---|---|
features | val features: List<SpatialFeature> The list of SpatialFeature instances managed by this FeatureManager |
| Name | Summary |
|---|---|
findFeature | inline fun <T : SpatialFeature> findFeature(): T Finds a feature of the specified com.meta.spatial.core.SpatialFeature class or throws an exception if not found. fun <T : SpatialFeature> findFeature(clazz: KClass<T>): T Finds a com.meta.spatial.core.SpatialFeature of the specified type or throws an exception if not found. |
tryFindFeature | inline fun <T : SpatialFeature> tryFindFeature(): T? Attempts to find a feature of the specified com.meta.spatial.core.SpatialFeature class. fun <T : SpatialFeature> tryFindFeature(clazz: KClass<T>): T? Attempts to find a com.meta.spatial.core.SpatialFeature of the specified type, or null if no matching feature is found. |