ScaleTool

The ScaleTool we wrote for HoloLens doubled as a teaching example of the GestureRecognizer, and thus made things more complicated than they should be. For the mobile version, we'll just rewrite the script so it's much more similar to the MoveTool one. Here is the whole thing:

File: ScaleTool.csusing UnityEngine; public class ScaleTool : MonoBehaviour { private PictureController picture; private bool isEditing = false; private Vector3 originaButtonScale; //Used to calculate the mouse position private Vector3 startPosition = Vector3.zero; private Vector3 currentPosition = Vector3.zero; private Vector3 initialScale = Vector3.zero; void Start() { picture = GetComponentInParent<PictureController>(); originaButtonScale = transform.localScale; ...

Get Augmented Reality for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.