Ejemplo n.º 1
0
    public virtual void Death()
    {
        GameMaster.instance.AddScore(100);
        spriteRend.sortingLayerName = "Environment";
        Instantiate(gem, transform.position, transform.rotation);

        lastHitPlayer.Check_OnKill();
        this.enabled = false;

        if (gameObject.GetComponent <Enemy_Husk>())
        {
            gameObject.GetComponent <Enemy_Husk>().enabled = false;
        }
        gameObject.GetComponent <SpriteRenderer>().color = Color.gray;
        if (gameObject.GetComponent <EnemyMovement>())
        {
            gameObject.GetComponent <EnemyMovement>().enabled = false;
        }
        gameObject.GetComponent <PolyNavAgent>().enabled     = false;
        gameObject.GetComponent <CircleCollider2D>().enabled = false;
    }