Generic Instance Method


Generates a publisher for events of the specified type.


func publisher<E>(for event: E.Type, on sourceObject: EventSource? = nil) -> Scene.Publisher<E> where E : Event



The event, like SceneEvents.Update.self.


The source of the event. Set to nil to publish all events of the given type within the scene.

Return Value

A publisher for events of the specified type.

See Also

Getting and Sending Events

struct Scene.Publisher

A publisher for the given event type in the scene.

enum SceneEvents

Events the scene triggers.

enum AnimationEvents

Events triggered by the RealityKit animation system.

enum AudioEvents

Events associated with audio playback.

enum CollisionEvents

Events associated with collisions.

protocol Event

A type that can be sent as an event.

protocol EventSource

A type on which events can be published and subscribed.