Changing GestureHandler.cs
We need a script where we can write the code to handle the anchors. We could create a new script, but in this case it would be much wiser to reuse an existing script. We have the GestureHandler script that is responsible for creating new instances of our guitar. It makes sense to use this. GestureHandler creates new instances of our guitar. One additional task along with creating that instance is to store its position in relation to a spatial anchor and store that anchor in the store. That way, it will be persisted, and we can load them up again when we restart our app. This implies that we have two ways of creating our guitars: one by tapping somewhere, as we have done until now, and the other when the app starts ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access