public void HurtEnemy(float damageCaused) { EnemyCurrentHealth -= damageCaused; if (EnemyCurrentHealth <= 0) { enemyItemDrop.ItemDrop(); NetworkServer.Destroy(transform.gameObject); } }
public void destroyObject() { gameObject.SetActive(false); if (gameObject.layer == 10) { EnemyItemDrop theEnemy = GetComponent <EnemyItemDrop>(); theEnemy.ItemDrop(); health = maxHealth; gameObject.GetComponent <GroundEnemy>().timedShot = false; } if (gameObject.layer == 11) { EnemyItemDrop theEnemy = GetComponent <EnemyItemDrop>(); theEnemy.ItemDrop(); health = maxHealth; } }