PictureAction

Open the PictureAction.cs script and modify it to use mouse events so that it reads as follows:

File: PictureAction.csusing UnityEngine; 
 
public class PictureAction : MonoBehaviour { 
    public PictureCommand command; 
 
    protected PictureController picture; 
    protected Animator animator; 
 
    void Start() { 
        picture = GetComponentInParent<PictureController>(); 
        animator = GetComponent<Animator>(); 
    } 
 
    void OnMouseDown() { 
        if (animator != null) { 
            animator.SetTrigger("Click"); 
        } 
        GameController.instance.PlayClickFeedback(); 
        Invoke("DoExecute", 1); 
    } 
 
    void DoExecute() { 
        picture.Execute(command); 
    } 
} 

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.