// Update is called once per frame void Update() { if (CurrentHealth <= 0) { questManager.enemyKilled = enemyQuestName; Destroy(gameObject); enemyCounter = enemyCounter + 1; thePlayerStats.AddExp(enemyExp); //moneyManager.AddMoney (moneyToGive); itemDroping.DropItem(chanceToDropItem); Instantiate(goldDrop, new Vector3(transform.position.x, transform.position.y, transform.position.z - 1.5f), transform.rotation); } }
public void DropItem() { Destroy(gameObject); Instantiate(destroyEffect, gameObject.transform.position, gameObject.transform.rotation); itemDrop.DropItem(chanceToDropItem); }