Esempio n. 1
0
        public void Update(GameTime gameTime)
        {
            ExplosionTest.Clear();
            if (0 == ExplosionDict.Count)
            {
                return;
            }

            keys.Clear();
            foreach (var key in ExplosionDict.Keys)
            {
                Explosion explosion = ExplosionDict[key];
                if (null == explosion || !explosion.IsExploding)
                {
                    continue;
                }

                // Update explosion but check to see if finished.
                explosion.Update(gameTime);
                if (!explosion.IsExploding)
                {
                    ExplosionTest.Add((Byte)explosion.EnemyID);
                    keys.Add(explosion.ID);
                }
            }

            // https://stackoverflow.com/questions/9892790/deleting-while-iterating-over-a-dictionary
            foreach (var key in keys)
            {
                ExplosionDict.Remove(key);
            }
        }
Esempio n. 2
0
 public void OnPointerDown(PointerEventData eventData)
 {
     //disable all other previews
     if (explosionTest != null)
     {
         explosionTest.explosionGameObject.SetActive(false);
     }
     explosionTest = this;
     if (eventData.button == PointerEventData.InputButton.Middle)
     {
         Debug.Log("input.middle");
         StartCoroutine(ReceiveDamage());
     }
 }
Esempio n. 3
0
 void Start()
 {
     explosionTest = GameObject.Find("ExplosionPoint").GetComponent <ExplosionTest>();
 }
Esempio n. 4
0
 public void Clear()
 {
     ExplosionTest.Clear();
     ExplosionDict.Clear();
 }
Esempio n. 5
0
 void Start()
 {
     explosionTest = transform.parent.GetComponent <ExplosionTest>();
 }