Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class ClickToInspect : MonoBehaviour {
- static bool open = false;
- void OnMouseUpAsButton()
- {
- if (!open)
- {
- // jet is not open. Open it up.
- transform.parent.animation["Explode"].speed = 1;
- transform.parent.animation.Play();
- open = true;
- } else {
- // jet is already open. Close it.
- transform.parent.animation["Explode"].speed = -1;
- transform.parent.animation["Explode"].time = 2;
- transform.parent.animation.Play();
- open = false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement