예제 #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);
            }
        }
예제 #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());
     }
 }
예제 #3
0
 void Start()
 {
     explosionTest = GameObject.Find("ExplosionPoint").GetComponent <ExplosionTest>();
 }
예제 #4
0
 public void Clear()
 {
     ExplosionTest.Clear();
     ExplosionDict.Clear();
 }
예제 #5
0
 void Start()
 {
     explosionTest = transform.parent.GetComponent <ExplosionTest>();
 }