maxxfrazer / RealityUI

A Swift Package for creating familiar UI Elements and animations in RealityKit. For both Augmented Reality or Virtual Reality scenes. Now with visionOS support.
https://maxxfrazer.github.io/RealityUI/
MIT License
665 stars 36 forks source link

HasClick to Component #19

Closed maxxfrazer closed 1 year ago

maxxfrazer commented 1 year ago

New component name: TapActionComponent

Usage:

let entity: Entity = ...
entity.components.set(TapActionComponent { tappedEntity, worldPosition in
    print("Entity \(tappedEntity) was tapped at \(worldPosition ?? .zero)!")
})

See: #18