// Update is called once per frame void Update() { healthBar.fillAmount = hp; anim.SetFloat("hp", hp); if (shake == true) { cs.cameraShake(); if (cs.shakeTimer <= 0) { shake = false; cs.reload(); } } }
public void Activate() { if (i >= 4) { if (timer > 0) { TimerStart(); cs.cameraShake(); cs.shakeTimer = 2f; } else { CancelInvoke("decreaseTimer"); nextQns(); timer = 3f; } } }
void countDown() { if (countdownT > 0) { countdownT -= 0.002f; //10sec } if (countdownT < 0) { cs.cameraShake(); if (cs.shakeTimer <= 0) { wt.nextQns(); hp.damage(); countdownT = 1f; cs.shakeTimer = 1f; } } clock.fillAmount = countdownT; }