/
Animacao_otto.cs
55 lines (53 loc) · 1.73 KB
/
Animacao_otto.cs
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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Animacao_otto : MonoBehaviour
{
// Start is called before the first frame update
Animator anim;
//destruir luzes
Light[] luzes_emergencia = new Light[14];
Light[] luzes_gerador = new Light[17];
GameObject[] luzes_piscando = new GameObject[4];
GameObject Tela;
Tela_morte telaMorte;
int contador = 2;
Tempo tempo;
AudioSource musica_fase;
void Start()
{
anim = gameObject.GetComponent<Animator>();
//destruir luzes
for (int i = 0; i < 17; i++)
{
luzes_gerador[i] = GameObject.Find("Luz_gerador (" + i + ")").GetComponent<Light>();
luzes_gerador[i].enabled = false;
}
for (int i = 0; i < 14; i++)
{
luzes_emergencia[i] = GameObject.Find("luz_emergencia (" + i + ")").GetComponent<Light>();
luzes_emergencia[i].enabled = false;
}
for(int i=0; i < 4; i++)
{
luzes_piscando[i] = GameObject.Find("Choquinho (" + i + ")");
Destroy(luzes_piscando[i]);
}
Destroy(GameObject.Find("Objeto_para_Otto"));
print("OTTO");
Tela = gameObject;
telaMorte = Tela.GetComponent<Tela_morte>();
tempo = GameObject.Find("TEMPO").GetComponent<Tempo>();
musica_fase = GameObject.Find("fase").GetComponent<AudioSource>();
}
// Update is called once per frame
void Update()
{
anim.Play("Otto_matando");
telaMorte.matou = true;
telaMorte.Monstro = 2;
tempo.stop = true;
musica_fase .enabled = false;
}
}