forked from GrzegorzBaweda/DisGame
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BossFightRewards.cs
43 lines (35 loc) · 919 Bytes
/
BossFightRewards.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
using UnityEngine;
using System.Collections;
public class BossFightRewards : MonoBehaviour {
public GameObject barrier1;
public GameObject barrier2;
public GameObject barrier3;
public GameObject barrier4;
public EnemyHealthManager bossHealth;
private int maxHealth;
// Use this for initialization
void Start () {
maxHealth = bossHealth.enemyHealth;
}
// Update is called once per frame
void Update () {
if (bossHealth.enemyHealth <= maxHealth * 0.9)
{
Destroy(barrier1);
}
if (bossHealth.enemyHealth <= maxHealth * 0.75)
{
Destroy(barrier2);
}
if (bossHealth.enemyHealth <= maxHealth * 0.5 && FindObjectOfType<CassiopeiaScript> ().fazeSwitch == false )
{
Destroy(barrier3);
FindObjectOfType<CassiopeiaScript>().nitroFaze = true;
Destroy(gameObject);
}
if (bossHealth.enemyHealth <= 0)
{
FindObjectOfType<CassiopeiaScript>().deadEnd = true;
}
}
}