private void OnTriggerExit(Collider other) { Baloon baloon = other.transform.parent.GetComponent <Baloon>(); if (baloon != null && baloonsInside.ContainsKey(baloon)) { baloonsInside.Remove(baloon); } }
void OnTriggerEnter(Collider other) { Baloon baloon = other.transform.parent.GetComponent <Baloon>(); if (baloon != null && !baloonsInside.ContainsKey(baloon)) { baloonsInside.Add(baloon, 0); } }
public void Died(Baloon baloon) { //check if any baloon is still left foreach (Baloon baloon1 in baloons) { if (!baloon1.Died()) { return; } } PlaySingleSound.SpawnSound(SoundManager.Me.LevelSuccess); ExplodeAllTiles(); }
private void CreateBaloons() { int count = 0; foreach (List <Tile> tileColumn in tiles) { Tile lastTile = tileColumn.Last(); Baloon baloonGO = Instantiate(baloonPrefab).GetComponent <Baloon>(); baloonGO.transform.position = lastTile.transform.position; baloonGO.gameObject.name = string.Format("Baloon {0}", ++count); baloonGO.GetComponentInChildren <Baloon>().Init(this); baloons.Add(baloonGO); } }