-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEnemy_List.cs
More file actions
106 lines (86 loc) · 3.47 KB
/
Enemy_List.cs
File metadata and controls
106 lines (86 loc) · 3.47 KB
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
100
101
102
103
104
105
106
using UnityEngine;
using System.Collections;
public class Enemy_List : MonoBehaviour {
public GameObject gameManager;
public GameObject[] enemies;
public GameObject[] clones;
public SceneSwitch scene;
public int i;
// Use this for initialization
void Start () {
gameManager = GameObject.FindGameObjectWithTag("GameManager");
scene = gameManager.GetComponent<SceneSwitch>();
if (scene.areaNum == 1)
{
i = RandomNumber(0, 8);
clones[0] = Instantiate(enemies[i]);
i = RandomNumber(0, 8);
clones[1] = Instantiate(enemies[i]);
i = RandomNumber(0, 8);
clones[2] = Instantiate(enemies[i]);
i = RandomNumber(0, 8);
clones[3] = Instantiate(enemies[i]);
clones[0].transform.position = new Vector3(4.5f, 2.0f, 0.0f);
clones[1].transform.position = new Vector3(4.5f, -2.0f, 0.0f);
clones[2].transform.position = new Vector3(3.0f, 0.0f, 0.0f);
clones[3].transform.position = new Vector3(6.0f, 0.0f, 0.0f);
}
else if (scene.areaNum == 6)
{
i = RandomNumber(4, 10);
clones[0] = Instantiate(enemies[i]);
i = RandomNumber(4, 10);
clones[1] = Instantiate(enemies[i]);
i = RandomNumber(4, 10);
clones[2] = Instantiate(enemies[i]);
i = RandomNumber(4, 10);
clones[3] = Instantiate(enemies[i]);
clones[0].transform.position = new Vector3(4.5f, 2.0f, 0.0f);
clones[1].transform.position = new Vector3(4.5f, -2.0f, 0.0f);
clones[2].transform.position = new Vector3(3.0f, 0.0f, 0.0f);
clones[3].transform.position = new Vector3(6.0f, 0.0f, 0.0f);
}
else if (scene.areaNum == 4)
{
i = RandomNumber(0, 8);
clones[0] = Instantiate(enemies[i]);
i = RandomNumber(0, 8);
clones[1] = Instantiate(enemies[i]);
i = RandomNumber(0, 8);
clones[2] = Instantiate(enemies[i]);
i = RandomNumber(0, 8);
clones[3] = Instantiate(enemies[i]);
clones[0].transform.position = new Vector3(4.5f, 2.0f, 0.0f);
clones[1].transform.position = new Vector3(4.5f, -2.0f, 0.0f);
clones[2].transform.position = new Vector3(3.0f, 0.0f, 0.0f);
clones[3].transform.position = new Vector3(6.0f, 0.0f, 0.0f);
}
else if (scene.areaNum == 10)
{
clones[0] = Instantiate(enemies[13]);//Boss Adult Brown Dragon
clones[0].transform.position = new Vector3(3.0f, 0.0f, 0.0f);
clones[1] = Instantiate(enemies[12]);//Boss Baby Brown Dragon
clones[1].transform.position = new Vector3(4.5f, 2.0f, 0.0f);
clones[2] = Instantiate(enemies[12]);//Boss Baby Brown Dragon
clones[2].transform.position = new Vector3(4.5f, -2.0f, 0.0f);
clones[3] = null;
}
else if (scene.areaNum == 11)
{
clones[0] = Instantiate(enemies[11]);//Boss Adult Brown Dragon
clones[0].transform.position = new Vector3(4.5f, 0.0f, 0.0f);
clones[1] = null;
clones[2] = null;
clones[3] = null;
}
}
// Update is called once per frame
void Update () {
}
int RandomNumber(int min, int max)
{
int randNum;
randNum = Random.Range(min, max);
return randNum;
}
}