Ejemplo n.º 1
0
    public override void noHealth()
    {
        print("Player is dead!");
        DisableEnemyAI();
        isDead        = true;
        inputDisabled = true;
        //invulnerableTime = 0;
        //invulnerable = false;
        currentState       = new IdleState(this);
        transform.position = new Vector3(transform.position.x, transform.position.y - 6.65f);
        transform.Rotate(0, 0, 90);
        GetComponent <Rigidbody2D>().velocity        = Vector2.zero;
        GetComponent <Rigidbody2D>().angularVelocity = 0;

        foreach (GameObject bullet in GameObject.FindGameObjectsWithTag("Fire"))
        {
            Physics2D.IgnoreCollision(bullet.GetComponent <BoxCollider2D>(), GetComponent <BoxCollider2D>());
        }

        menu.GameOverPause();
    }