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

Moved HasClick protocol to a component, TapActionComponent. #20

Closed maxxfrazer closed 1 year ago

maxxfrazer commented 1 year ago

Refer to Issue #19

Example usage:

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