Added upgrade descriptions to upgrader
This commit is contained in:
parent
b1e67478f6
commit
6517c26fc3
|
@ -1,4 +1,5 @@
|
|||
using System.Collections;
|
||||
using TMPro;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine;
|
||||
|
@ -59,6 +60,7 @@ public class Upgrader : MonoBehaviour
|
|||
private bool prevCouldUpgrade = true;
|
||||
|
||||
public Image BloodMeter;
|
||||
public TMPro.TextMeshPro description;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
|
@ -179,6 +181,8 @@ public class Upgrader : MonoBehaviour
|
|||
}
|
||||
else
|
||||
{
|
||||
description.text = "";
|
||||
|
||||
if (acceptTime > 0f)
|
||||
{
|
||||
foreach (Image i in upgradeImages)
|
||||
|
@ -194,10 +198,14 @@ public class Upgrader : MonoBehaviour
|
|||
}
|
||||
else if (prevCouldUpgrade)
|
||||
{
|
||||
// TODO: PLAY SOUND HERE!!
|
||||
|
||||
description.text = "";
|
||||
background.color = Color.gray;
|
||||
foreach (Image i in upgradeImages)
|
||||
{
|
||||
i.color = Color.gray;
|
||||
i.gameObject.transform.localScale = Vector3.one;
|
||||
}
|
||||
|
||||
Player1Cursor.gameObject.SetActive(false);
|
||||
|
@ -213,6 +221,7 @@ public class Upgrader : MonoBehaviour
|
|||
/// Increases mop radius by 10%
|
||||
public void UpgradeMopSize()
|
||||
{
|
||||
description.text = upgrades.mopUpgrade.name;
|
||||
bloodManager.CleanRadius *= mopSizeIncrease;
|
||||
upgrades.mopUpgrade.amount++;
|
||||
}
|
||||
|
@ -220,6 +229,7 @@ public class Upgrader : MonoBehaviour
|
|||
/// Increases move speed by 10%
|
||||
public void UpgradeSpeed()
|
||||
{
|
||||
description.text = upgrades.speedUpgrade.name;
|
||||
player1.GetComponent<PlayerMovement>().moveSpeed *= speedIncrease;
|
||||
player2.GetComponent<PlayerMovement>().moveSpeed *= speedIncrease;
|
||||
upgrades.speedUpgrade.amount++;
|
||||
|
@ -228,12 +238,15 @@ public class Upgrader : MonoBehaviour
|
|||
public void RopeUpgrade()
|
||||
{
|
||||
// todo: public methods
|
||||
description.text = upgrades.ropeUpgrade.name;
|
||||
rope.ropeMaxLength *= ropeIncrease;
|
||||
upgrades.ropeUpgrade.amount++;
|
||||
}
|
||||
|
||||
public void HealthUpgrade()
|
||||
{
|
||||
description.text = upgrades.healthUpgrade.name;
|
||||
|
||||
var comp1 = player1.GetComponent<HealthComponent>();
|
||||
comp1.setMaxHealth((int)(comp1.getMaxHealth() * healthIncrease));
|
||||
|
||||
|
@ -244,6 +257,7 @@ public class Upgrader : MonoBehaviour
|
|||
|
||||
public void DamageUpgrade()
|
||||
{
|
||||
description.text = upgrades.damageUpgrade.name;
|
||||
// todo: public rope methods
|
||||
// rope.da
|
||||
upgrades.damageUpgrade.amount++;
|
||||
|
@ -251,6 +265,7 @@ public class Upgrader : MonoBehaviour
|
|||
|
||||
public void BloodUpgrade()
|
||||
{
|
||||
description.text = upgrades.bloodUpgrade.name;
|
||||
bloodManager.scoreMult *= bloodIncrease;
|
||||
upgrades.bloodUpgrade.amount++;
|
||||
}
|
||||
|
@ -258,15 +273,18 @@ public class Upgrader : MonoBehaviour
|
|||
public void ReelUpgrade()
|
||||
{
|
||||
// todo rope methods
|
||||
description.text = upgrades.reelUpgrade.name;
|
||||
rope.ropeExtendSpeed *= reelIncrease;
|
||||
upgrades.reelUpgrade.amount++;
|
||||
}
|
||||
|
||||
IEnumerator updateBloodMeter() {
|
||||
while (true) {
|
||||
IEnumerator updateBloodMeter()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
yield return new WaitForSeconds(0.5f);
|
||||
|
||||
BloodMeter.fillAmount = ((float)bloodManager.score)/((float)upgradeCost);
|
||||
BloodMeter.fillAmount = ((float)bloodManager.score) / ((float)upgradeCost);
|
||||
}
|
||||
|
||||
// dont care
|
||||
|
|
Loading…
Reference in New Issue