protected void Detonate() { SoundsController.Get().PlayExplosion(); animator.SetTrigger(KeysHolder.ANIM_DETONATE_TRIGGER); Destroy(gameObject, KeysHolder.ANIM_TIME); gameController.StopGame(); }
public override void Press() { base.Press(); SoundsController.Get().PlayHide(); StopCoroutine(countdownCoroutine); countdownCoroutine = null; animator.SetTrigger(KeysHolder.ANIM_HIDE_TRIGGER); Destroy(gameObject, KeysHolder.ANIM_TIME); }
protected override IEnumerator Countdown() { while (lifeTime > 0) { lifeTime -= Time.deltaTime; yield return(null); } SoundsController.Get().PlayHide(); Destroy(gameObject, KeysHolder.ANIM_TIME); animator.SetTrigger(KeysHolder.ANIM_HIDE_TRIGGER); }
private void Start() { SoundsController.Get().PlayTicking(); countdownCoroutine = StartCoroutine(Countdown()); }