Interacting to edit a picture
We will now implement the ability to move and resize a virtual object we have placed in the AR scene. For this, I've decided to give the object being edited responsibility for its own interactions. That is, when FramedPhoto is being edited, it'll listen for input action events and move or resize itself.
I've also decided to implement these features as separate components, MovePicture
and ResizePicture
, on the FramedPhoto prefab. This will only be enabled while FramedPhoto is being edited. First, let's ensure that instantiated FramedPhoto objects receive Input Action messages so that they can respond to user input.
Ensuring FramedPhoto objects receive Input Action messages
We are currently using the Unity Input System, which lets you define and configure user input actions, as well as listening for those action events with a Player Input component. Currently, the scene has one Player Input component, attached to the Interaction...