Exemple #1
0
    //what happens when certain enemy dies
    public override void Die()
    {
        if (tag == "Boss")
        {
            SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
        }
        else
        {
            base.Die();
            if (tag == "SpiderQueen")
            {
                ObjectivesManager.instance.DrawText("Find the portal.");
            }
            // death animation
            if (ragdoll != null)
            {
                GetComponent <CharacterAnimator>().isActive = false;
                ragdoll.Setup();
            }
            else
            {
                animator.SetTrigger("dead");
            }

            StartCoroutine(DestroyObject(30));

            enemyController.active = false;
            enemy.radius           = 0f;

            //loot
            LootManager lootManager = GetComponent <LootManager>();
            lootManager.DropLoot();
        }
    }