Fixed sound/visual bug with overcharged points
This commit is contained in:
parent
e072c279e6
commit
e18ee9eade
1 changed files with 12 additions and 6 deletions
|
@ -53,10 +53,16 @@ public class ChargePoint : MonoBehaviour
|
|||
charged = false;
|
||||
}
|
||||
|
||||
if (amount < 0) soundUncharge.Play();
|
||||
else if (charges == 1) soundCharge1.Play();
|
||||
else if (charges == 2) soundCharge2.Play();
|
||||
else if (charges == 3) soundCharge3.Play();
|
||||
if (amount < 0)
|
||||
{
|
||||
if (charges < chargesRequired) soundUncharge.Play();
|
||||
}
|
||||
else if (amount > 0)
|
||||
{
|
||||
if (charges == 1) soundCharge1.Play();
|
||||
if (charges == 2 && chargesRequired >= 2) soundCharge2.Play();
|
||||
if (charges == 3 && chargesRequired >= 3) soundCharge3.Play();
|
||||
}
|
||||
|
||||
VisualUpdate();
|
||||
}
|
||||
|
@ -74,8 +80,8 @@ public class ChargePoint : MonoBehaviour
|
|||
if (chargesRequired < 3) innerRing.color = transparent;
|
||||
if (chargesRequired < 2) middleRing.color = transparent;
|
||||
if (charges >= 1) outerRing.color = chargedColor;
|
||||
if (charges >= 2) middleRing.color = chargedColor;
|
||||
if (charges >= 3) innerRing.color = chargedColor;
|
||||
if (charges >= 2 && chargesRequired >= 2) middleRing.color = chargedColor;
|
||||
if (charges >= 3 && chargesRequired >= 3) innerRing.color = chargedColor;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue