private void OnTriggerStay(Collider other) { if (readyToStrike) { if (other.CompareTag("Player")) { Explosion.SetActive(true); _isMeteoriteKillEarth = false; PlayerHitPoints.MinusAllHP(); } if (other.CompareTag(Mine.tag)) { if (_isMeteoriteDestroyed) { return; } Explosion.SetActive(true); _isMeteoriteKillEarth = false; _isMeteoriteDestroyed = true; Destroy(other.gameObject); /// ударилось в поле } } }
IEnumerator CheckMeteoriteKillEarth() { yield return(new WaitForSeconds(currentTime)); if (_isMeteoriteKillEarth) { PlayerHitPoints.MinusAllHP(); Debug.Log("ударилось в Землю"); } }