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.

Home Page:https://maxxfrazer.github.io/RealityUI/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Move to Components

maxxfrazer opened this issue · comments

Some of the features in this project can/should be moved from protocols to components, such as HasClick.

Tasks

  • Find all pieces which can/should be migrated to components, left in the comments here.
  • Issues for each component piece linked to this one.
  • PR's for each component added to staging branch, with tests added.
  • Update documentation for all before merging to main.

Note: This will require a major version bump to 2.0.0

Reasoning

  • Adherence to Entity-Component System (ECS): RealityKit is built on top of an Entity-Component System architecture. Using components instead of protocols embraces the architectural foundations of RealityKit, ensuring your code leverages the framework's inherent design patterns for more seamless integration.
  • Modularity and Flexibility: Components promote modular design. By separating the click action into its component, you can easily attach, modify, or remove functionalities without altering the core entity or other unrelated components. It also allows you to attach the same functionality to various entities regardless of their other functionalities or hierarchies.

Another important factor is future-proofing this library. RealityKit is at it's core an ECS, and will likely play nicer with classes that adhere to that in the future.

Contributions

Contributions are more than welcome for this update, please let me know if you'd like to help!
This will be the first major update of RealityUI, so input such as suggested components or their names would be greatly appreciated.
As this is a breaking change, I want it to be something really worth upgrading.

Started moving the long gesture to a component. Starting with a free movement one:

carbon-111

Screen.Recording.2023-11-14.at.08.20.31.mov

Almost complete, will update README further before merging to main.

Merged, alongside (partial) visionOS support 🎉