public void DestroyObject() { if (particles != null) { Destroy(Instantiate(particles, transform.position, transform.rotation), 1); } if (reward != null) { reward.Activate(transform.position); } Destroy(gameObject); }
private void UpdateReward() { string preserveKey = reward.Key; reward = factory.Generate(choreNameTextbox.Text, descriptionTextbox.Text, (Double)priceUpDown.Value); reward.SetKey(preserveKey); if (isActiveCheckbox.Checked) { reward.Activate(); } else { reward.Inactivate(); } }
void Die() { if (deathParticles != null) { Destroy(Instantiate(deathParticles, transform.position, transform.rotation), 2); } if (reward != null) { reward.Activate(transform.position); } if (Game.Instance.enemies.Count == 1) { LootManager.Instance.DropLoot(transform.position); } Game.Instance.enemies.Remove(this); Destroy(gameObject); }