TO SQUASH: Jesus!!
This commit is contained in:
@@ -48,7 +48,7 @@ public class Multiplier : MonoBehaviour
|
||||
if (stateTimer >= stateDuration)
|
||||
{
|
||||
stateTimer = 0f;
|
||||
multiplierValue = ((multiplierValue + 1) % 4);
|
||||
multiplierValue = (multiplierValue + 1) % 4;
|
||||
multiplierAnimator.SetInteger("bonus", multiplierValue + 1);
|
||||
}
|
||||
|
||||
@@ -66,4 +66,25 @@ public class Multiplier : MonoBehaviour
|
||||
yield return new WaitForSeconds(1.5f);
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
public void AwardToPlayer(Player player)
|
||||
{
|
||||
if (isActive)
|
||||
{
|
||||
isActive = false;
|
||||
if (multiplierValue == 0)
|
||||
{
|
||||
audioSource.PlayOneShot(gotHalfSound);
|
||||
player.multiplier = 0.5f;
|
||||
}
|
||||
else
|
||||
{
|
||||
audioSource.PlayOneShot(gotItSound);
|
||||
player.multiplier = (float)(multiplierValue + 1);
|
||||
}
|
||||
|
||||
multiplierSpriteRenderer.enabled = false;
|
||||
StartCoroutine(DestroyAfterDelay());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user