public void OnDamage() { health--; if (health <= 0) { MC.Death(); } }
void Update() { timer += Time.deltaTime; timerText.text = ((int)timer).ToString(); if (timer >= 30.0f) { timer = 0; Debug.Log("mc death"); MC.Death(); } }