Ejemplo n.º 1
0
    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);
                /// ударилось в поле
            }
        }
    }
Ejemplo n.º 2
0
    IEnumerator CheckMeteoriteKillEarth()
    {
        yield return(new WaitForSeconds(currentTime));

        if (_isMeteoriteKillEarth)
        {
            PlayerHitPoints.MinusAllHP();
            Debug.Log("ударилось в Землю");
        }
    }