Пример #1
0
 void Die()
 {
     //Do special things
     //Do default things
     beeHealth.Die();
     Destroy(gameObject);
 }
Пример #2
0
    void Die()
    {
        Debug.Log("rip elemental boss");
        GameObject.Find("Door").SetActive(false);
        GameStateManager.GreenJewelBossDead = true;

        bossHealth.Die();
    }
Пример #3
0
    void Die()
    {
        //Do special things
        Debug.Log("Bee ded");

        //Do default things
        BeeHealth.Die();
    }
Пример #4
0
 void Die()
 {
     //Do special things
     Debug.Log("Hive ded");
     GameObject.Find("Door").SetActive(false);
     //Do default things
     Destroy(gameObject);
     hiveHealth.Die();
 }
Пример #5
0
    void Die()
    {
        //Do special things
        Debug.Log("API Boss");
        door1.SetActive(false);
        door2.SetActive(false);
        entrance.SetActive(true);
        GameStateManager.RedShieldBossDead = true;

        //Do default things
        APIBossHealth.Die();
    }
 private void OnTriggerEnter2D(Collider2D col)
 {
     if (col.gameObject.tag == "Bullet")
     {
         _em.state     = EnemyMovement.eState.knockback;
         _em.bulletDir = transform.position - col.transform.position;
         _eh.health--;
         Destroy(col.gameObject);
         if (_eh.health <= 0)
         {
             _eh.Die();
         }
     }
 }
Пример #7
0
 void Die()
 {
     if (segs.Count == 1)
     {
         Destroy(gameObject);
         Time.timeScale = 0;
         text.SetActive(true);
     }
     else
     {
         segs.RemoveAt(segs.Count - 1);
         currentEH.Die();
         ChangeKillableSegment();
     }
 }
Пример #8
0
 void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Enemy"))
     {
         EnemyHealth hp = other.gameObject.GetComponent <EnemyHealth>();
         if (hp != null)
         {
             hp.Die(false);
         }
         else
         {
             Destroy(other.gameObject);
         }
         Destroy(gameObject);
     }
 }
Пример #9
0
    void Fire()
    {
        muzzleFlash.Play();
        source.PlayOneShot(gunSound, 0.3f);
        currAmmo--;
        animator.SetInteger("condition", 6);

        RaycastHit hit;

        if (Physics.Raycast(Camera.main.transform.position, Camera.main.transform.forward * 100, out hit, database.weapons[id].range))
        {
            enemyStat = hit.transform.gameObject.GetComponent <EnemyHealth>();
            if (hit.transform.gameObject.tag == "Enemy")
            {
                if (!enemyStat.isDead)
                {
                    enemyStat.TakeDamage(database.weapons[id].damage);

                    if (enemyStat.currentHealth <= 0)
                    {
                        enemyStat.isDead = true;
                        Instantiate(healthPackage, hit.transform.position, hit.transform.rotation);
                        coins          = coins + 10;
                        coinsText.text = coins.ToString();
                        enemyStat.Die();
                        //hit.transform.gameObject.SetActive(false);
                    }
                }
            }

            if (hit.rigidbody != null)
            {
                hit.rigidbody.AddForce(-hit.normal * impactForce);
            }
            GameObject impactGO = Instantiate(impactEffect, hit.point, Quaternion.LookRotation(hit.normal));
            Destroy(impactGO, 1f);
        }
    }