Adding the anchor mode button

Next, add the button that lets the user set the graphics position:

  1. At the Hierarchy root, create UI | Button and name it Anchor Button.
  2. Set its Height to 100.
  3. Set Anchor Presets to Bottom/Stretch, then Alt+click to position it there.
  4. Adjust its Pos Y position to 100 to leave room for the AR Mode button.
  5. Set Source Image to none; we picked a darker green Color: #004C5EFF.
  6. For its child Text object, set Text to Set graphic position, Font Size: 25, Color: white.

Now to wire up the Anchor button:

  1. Select the Anchor Button and add the OnClick event.
  2. Press the + in the OnClick list.
  3. Drag the Game Controller to the Object slot, then choose the function InstructionsController.ToggleAnchor().

If you press Play now, you can get into Anchor mode, but cannot get out because there's more to do. We need to respond to the user's screen touch to change the AR Root object position.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.1.232