-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDecreaseMultiPowerUp.cs
31 lines (29 loc) · 1022 Bytes
/
DecreaseMultiPowerUp.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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DecreaseMultiPowerUp : PowerUpScript
{
public override void DoPowerup()
{
if (PlayerString == "Player1")
{
StartCoroutine(UIManager.Instance.PlayPowerupAnim(0, "Enemy x0.5", 0));
StartCoroutine(DecreaseMultiplier(1));
}
else if (PlayerString == "Player2")
{
StartCoroutine(UIManager.Instance.PlayPowerupAnim(0, "Enemy x0.5", 1));
StartCoroutine(DecreaseMultiplier(0));
}
}
private IEnumerator DecreaseMultiplier(int index)
{
if (GameManager.Instance.ScoreMultiplier[index] !< 0.5f)
{
float currentScore = GameManager.Instance.ScoreMultiplier[index];
GameManager.Instance.ScoreMultiplier[index] = 0.5f;
yield return new WaitForSeconds(15);
GameManager.Instance.ScoreMultiplier[index] = currentScore;
}
}
}