Exemple #1
0
 public void DestroyObject()
 {
     if (particles != null)
     {
         Destroy(Instantiate(particles, transform.position, transform.rotation), 1);
     }
     if (reward != null)
     {
         reward.Activate(transform.position);
     }
     Destroy(gameObject);
 }
Exemple #2
0
        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();
            }
        }
Exemple #3
0
 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);
 }