Esempio n. 1
0
    public override void Die()
    {
        if (!isBoss)
        {
            GetComponent <Collider2D>().enabled = false;
            manager.RemoveEnemy();
        }

        lifeBar.EnableLifeBar(false);

        dropItem();
        if (ai != null)
        {
            ai.setAlive(false);
        }
        else if (distAi != null)
        {
            distAi.setAlive(false);
        }

        int moneyWon = UnityEngine.Random.Range(borneInfMoney, borneSupMoney);

        GameObject.FindGameObjectWithTag("Player").GetComponent <Player>().ShowBonusEffect(moneyWon, 6);
        GameObject.FindGameObjectWithTag("Player").GetComponent <Player>().gold += moneyWon;
        GameObject.FindGameObjectWithTag("Player").GetComponent <InventaireScript>().updateMenuInventaire();
        base.Die();
    }
Esempio n. 2
0
    public override void Die()
    {
        base.Die();
        if (!isBoss)
        {
            GetComponent <BoxCollider2D>().enabled = false;
            manager.RemoveEnemy();
        }

        lifeBar.EnableLifeBar(false);

        dropItem();
        if (ai != null)
        {
            ai.enabled = false;
        }
        else if (distAi != null)
        {
            distAi.enabled = false;
        }

        GameObject.FindGameObjectWithTag("Player").GetComponent <Player>().gold += UnityEngine.Random.Range(borneInfMoney, borneSupMoney);
    }