Пример #1
0
    public void TakeDamage(float damage)
    {
        health -= damage;
        Debug.Log(health);

        if (health <= 0f)
        {
            spriteAnimator.AnimateDead();
        }
    }
Пример #2
0
    public void TakeDamage(float damage)
    {
        health -= damage;

        if (health <= 0f)
        {
            gameManager.AddScore(score);

            spriteAnimator.AnimateDead();
            StartCoroutine(EnemyWaitDead(3));
            Destroy(gameObject);
        }
    }
Пример #3
0
 private void OnDisable()
 {
     m_Rigidbody2d.isKinematic = true;
     m_SpriteAnimator.AnimateDead();
 }