View difference between Paste ID: nbC06Fr5 and 2M6wBwxz
SHOW: | | - or go back to the newest paste.
1
using UnityEngine;
2
using System.Collections;
3
4
public class ClickToInspect : MonoBehaviour {
5
	
6
	
7
	public CameraView view;
8
	public NarrationControl narration;
9
	
10
	static bool open = false;
11
	
12
	void OnMouseUpAsButton()
13
	{
14
		if (!open)
15
		{
16
			// jet is not open. Open it up.
17
			transform.parent.animation["Explode"].speed = 1;
18
			transform.parent.animation.Play();
19
			open = true;
20
			TrainingCamera.GoTo(view);
21
			
22
			narration.Play( name );
23
			
24
		} else {
25
			// jet is already open. Close it.
26
			transform.parent.animation["Explode"].speed = -1;
27
			transform.parent.animation["Explode"].time = 2;
28
			transform.parent.animation.Play();
29
			open = false;
30
			TrainingCamera.GoToDefault();
31
			
32
			
33
		}
34
		
35
		
36
	}
37
	
38
}