void onCollisionHander(Collision2D collision) { if (collision.gameObject.tag == "ground") { this.spawnmanager.game.bombMissed(this.eq); SimplePool.Despawn(this.gameObject); } else { if (collision.gameObject.tag == "tile") { singleTileBehaviour tile = collision.gameObject.GetComponent <singleTileBehaviour>(); tile.OnEndDrag(null); if (tile.eq.answer == this.eq.answer) { this.spawnmanager.game.bombDefused(this.eq); // shot animation animator.Play("balloon_splash"); Invoke("postSplash", 0.5f); } } } }
public void setupAnswers(bool shuffle = false) { var eqs = this.game.getNextEquations(this.maxTiles); if (shuffle) { this.equations = this.shuffle(eqs); } else { this.equations = eqs; } for (var i = 0; i < this.maxTiles; i++) { singleTileBehaviour newTile = this.tiles[i].GetComponent <singleTileBehaviour>(); newTile.setEq(this.equations[i]); } }