Exemple #1
0
    /// <summary>
    /// Kills the enemy
    /// </summary>
    public void Death()
    {
        if (m_entityType == m_entityTypes.TYPE_ENEMY)
        {
            m_gData.AddScore(100);
        }
        else if (m_entityType == m_entityTypes.TYPE_BOSSENEMY)
        {
            m_gData.AddScore(1500);
        }

        GetComponent <AudioSource>().Play();
        m_isAlive = false;
        m_enemyAnimator.Play("Dead");
        StartCoroutine(DelayedRemoval());
        GetComponent <PolygonCollider2D>().enabled = false;
    }