Пример #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();
        }
    }
Пример #2
0
    void Die()
    {
        ragdoll.transform.parent = null;
        ragdoll.Setup();
        Destroy(gameObject);

        youWin.SetActive(true);
    }
Пример #3
0
 void Die()
 {
     deathPoint = enemyPoint.position;
     deathPoint = new Vector3(deathPoint.x, deathPoint.y + .5f, deathPoint.z);
     Instantiate(lootObject, deathPoint, Quaternion.identity);
     ragdoll.transform.parent = null;
     ragdoll.Setup();
     Destroy(gameObject);
 }
Пример #4
0
 void Die()
 {
     ragdoll.transform.parent = null;
     ragdoll.Setup();
     Destroy(gameObject);
     if (GameObject.FindWithTag("Boss"))
     {
         anim.Play("Die");
     }
 }
Пример #5
0
    private void OnEnable()
    {
        type = Random.Range(0, 3);

        if (type <= 0)
        {
            anim.SetBool("Melee", true);
        }
        else
        {
            if (type <= 1)
            {
                anim.SetBool("Rifle", true);
                rifle.SetActive(true);
            }
            else
            {
                anim.SetBool("Pistol", true);
                pistol.SetActive(true);
            }
        }

        ragdoll.Setup();
    }
Пример #6
0
 void Die()
 {
     ragdoll.transform.parent = null;
     ragdoll.Setup();
     Destroy(gameObject);
 }