Selecting a picture to edit
While in Main-mode, the user should be able to tap on an existing picture to edit it. Utilizing the Unity Input System, we will add a new SelectObject
input action. Then, we'll have the MainMode
script listen for that action's messages, find which picture was tapped using a Raycast
, and enable Edit-mode on that picture. Let's get started!
Defining a SelectObject input action
We will start by adding a SelectObject
action to the AR Input Actions asset by performing the following steps:
- In the Project window, locate and double-click the AR Input Actions asset we created previously (it may be in the
Assets/Inputs/
folder) to open it for editing (alternatively, use its Edit Asset button). - In the middle Actions section, select + and name it
SelectObject
. - In the rightmost Properties section, select Action Type | Value and Control Type | Vector 2.
- In the middle Actions section, select the <No Binding> child. Then, in...