public void SplashColour(Tile location, ColourOfPaint inColour) { Tile[] splashedTiles = new Tile[9]; splashedTiles[0] = Tiles [location.PosX, location.PosZ]; splashedTiles[1] = Tiles [(Mathf.Clamp(location.PosX - 1, 0, SIZEOFARENA - 1)), location.PosZ]; splashedTiles[2] = Tiles [(Mathf.Clamp(location.PosX - 2, 0, SIZEOFARENA - 1)), location.PosZ]; splashedTiles[3] = Tiles [(Mathf.Clamp(location.PosX + 1, 0, SIZEOFARENA - 1)), location.PosZ]; splashedTiles[4] = Tiles [(Mathf.Clamp(location.PosX + 2, 0, SIZEOFARENA - 1)), location.PosZ]; splashedTiles [5] = Tiles [location.PosX, (Mathf.Clamp(location.PosZ - 1, 0, SIZEOFARENA - 1))]; splashedTiles [6] = Tiles [location.PosX, (Mathf.Clamp(location.PosZ - 2, 0, SIZEOFARENA - 1))]; splashedTiles [7] = Tiles [location.PosX, (Mathf.Clamp(location.PosZ + 1, 0, SIZEOFARENA - 1))]; splashedTiles [8] = Tiles [location.PosX, (Mathf.Clamp(location.PosZ + 2, 0, SIZEOFARENA - 1))]; Debug.Log("Checking for stuns and crates"); for (int i = 0; i < 9; i++) { splashedTiles [i].ChangeColour(inColour); AffectPlayers(splashedTiles [i]); DestroyCrates(splashedTiles [i]); } }
public void ChangeColour(ColourOfPaint inColour) { this.ColourOnTile = inColour; }