October 2017
Intermediate to advanced
548 pages
13h 23m
English
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);
}
}
Read now
Unlock full access