-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOverTimeScoreIncreasePowerUp.cs
46 lines (44 loc) · 1.34 KB
/
OverTimeScoreIncreasePowerUp.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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class OverTimeScoreIncreasePowerUp : PowerUpScript
{
private void Update()
{
if (Input.GetKeyDown(KeyCode.B))
{
StartCoroutine(UIManager.Instance.PlayPowerupAnim(4, "Overtime Score", 0));
}
if (Input.GetKeyDown(KeyCode.M))
{
StartCoroutine(UIManager.Instance.PlayPowerupAnim(4, "Overtime Score", 1));
}
}
public override void DoPowerup()
{
StartCoroutine(OverTimeScoreIncrease());
}
IEnumerator OverTimeScoreIncrease()
{
if (PlayerString == "Player1")
{
for (int i = 0; i < 5; i++)
{
GameManager.Instance.Score[0] += 100;//score werkt
StartCoroutine(UIManager.Instance.PlayScoreAnim(100, 0));
if (i != 5)
yield return new WaitForSeconds(1.5f);
}
}
else if (PlayerString == "Player2")
{
for (int i = 0; i < 5; i++)
{
GameManager.Instance.Score[1] += 100;
StartCoroutine(UIManager.Instance.PlayScoreAnim(100, 1));
if (i != 5)
yield return new WaitForSeconds(1.5f);
}
}
}
}