예제 #1
0
    public void TakeDamage(float damage)
    {
//		Debug.Log(gameObject.name + " TakeDamage "+damage);


        if (invulnerable)
        {
            return;
        }

        currentLife = Mathf.Clamp(currentLife - damage, 0, maxLife);

        if (currentLife == 0)
        {
            player.DestroyShip();

            Explode();

            Destroy(this);
        }
    }