Subversion Repository Public Repository

Nextrek

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
using UnityEngine;
using System.Collections;

public class SU_CameraAnimation1 : MonoBehaviour {

	public GameObject dialogo1;
	public GameObject dialogo2;
	public GameObject dialogo3;
	public GameObject thurster;
	public GameObject thurster2;
	public GameObject spaceship;
	public GameObject spaceCamera;
	public float tempoCamera = 2f;
	public float tempoCamera2 = 5f;
	public float tempoCamera3 = 8f;
	public GameObject nebula;
	
	
	// Use this for initialization
	void Start () {
		spaceCamera.SetActive (true);
		audio.volume = 0.2F;
	}
	
	// Update is called once per frame
	void Update () {
		transform.position += new Vector3 (0, 0, (15*Time.deltaTime));
		spaceship.transform.position += new Vector3 (0, 0, 15*Time.deltaTime);
		
		tempoCamera -= Time.deltaTime;
		tempoCamera2 -= Time.deltaTime;
		tempoCamera3 -= Time.deltaTime;
		
		if (tempoCamera < 0) {
			ShowDialogo(true);
		}
		if (tempoCamera < -3) {
			ShowDialogo(false);
		}
		
		if (tempoCamera2 < 0) {
			ShowDialogo1(true);
		}
		
		if (tempoCamera2 < -3) {
			ShowDialogo1(false);
		}
		
		if (tempoCamera3 < 0) {
			ShowDialogo2(true);
			
		}
		
		if (tempoCamera3 < -3) {
			ShowDialogo2(false);
			thurster.particleSystem.startSize = 14 ;
			thurster.particleSystem.startLifetime = 2.5f;
			thurster.particleSystem.startSpeed = 30;
			thurster2.particleSystem.startSize = 14;
			thurster2.particleSystem.startLifetime = 2.5f;
			thurster2.particleSystem.startSpeed = 30;
			spaceship.transform.position += new Vector3 (0, 2*Time.deltaTime, 18*Time.deltaTime);
			audio.volume = 1F;
		}
		
		
		nebula.transform.Rotate (Vector3.back* 10 * Time.deltaTime);
		
	}
	
	public void ShowDialogo(bool show)
	{
		if(dialogo1.activeSelf!=show)
		{
			dialogo1.SetActive(show);
		}
		
	}
	
	public void ShowDialogo1(bool show)
	{
		if(dialogo2.activeSelf!=show)
		{
			dialogo2.SetActive(show);
		}
		
		
	}
	
	public void ShowDialogo2(bool show)
	{
		if(dialogo3.activeSelf!=show)
		{
			dialogo3.SetActive(show);
		}
		
		
	}
}

Commits for Nextrek/3DSpace/Assets/SpaceUnity/_Demo/Scrips/SU_CameraAnimation1.cs

Diff revisions: vs.
Revision Author Commited Message
164 LMancini picture LMancini Wed 01 Apr, 2015 16:20:39 +0000