Ejemplo n.º 1
0
    void Dead()
    {
        //Spawn object, Do animation/particles, Destroy Object
        if (!_isBoss)
        {
            doDamageScript.damageSet = false;
        }
        flash.SetActive(false);

        if (_isBoss == true)
        {
            BossHealthObject.SetActive(false);
            barScript.challengeCounters[1]++;
            Instantiate(deathEffect, this.gameObject.transform.position, Quaternion.Euler(270, 45, 0));
            //Loot(2);
        }
        else
        {
            float pickReward = Random.value;
            if (pickReward <= 0.6)
            {
                //Loot(0);
            }
            else
            {
                //Loot(1);
            }
        }

        if (!_isBoss)
        {
            if (barScript.GetAcidSkull() == true)
            {
                float randomChance = Random.value;
                if (randomChance >= 0.9f)
                {
                    barScript.AcidSkullTrigger();
                }
            }
        }

        barScript.LookForKey(2);
        barScript.killedEnemyCount++;
        barScript.challengeCounters[0]++;
        //Disable this GameObject instead of destroy
        Destroy(this.gameObject);
    }