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