API reference
API reference
Select your platform
No SDKs available
No versions available

FeatureManager

FeatureManager

class FeatureManager(val features: List<SpatialFeature>)
Manages a collection of com.meta.spatial.core.SpatialFeature instances for your Spatial SDK activity.
The FeatureManager is responsible for:
  • Storing and providing access to registered features
  • Managing feature lifecycle events
  • Checking feature dependencies
  • Registering components and systems from features
Example usage of registering features:
// ImmersiveActivity.kt (your immersive Spatial SDK activity)
override fun registerFeatures(): List<SpatialFeature> {
  return listOf(
    VRFeature(),
    IsdkFeature(),
    PhysicsFeature())
}
Example usage of accessing features:
// ImmersiveActivity.kt (your immersive Spatial SDK activity)
fun myHelperFunction() {
  val toolkitFeature = featureManager.tryFindFeature<ToolkitFeature>()
  ...
}

Constructors

NameSummary
FeatureManager
constructor(features: List<SpatialFeature>)

Properties

NameSummary
features
val features: List<SpatialFeature>

The list of SpatialFeature instances managed by this FeatureManager

Functions

NameSummary
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.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon