void OnMatchingDone(List <Tile> tiles) { int count = tiles.Count; DoubleInt max = bGenerator.Grid; currentMatchCountList = new List <int>(); cManager.ChangeCombatState(CombatState.MatchClearing); //Won't Affect Tiles OnStartBoardEffect.Invoke(tiles); //Get How much tiles need to be fill for every row for (int y = 0; y < max.y; y++) { currentMatchCountList.Add(0); } foreach (var item in tiles) { ClearMatchedTiles(item.Coord.x, item.Coord.y); } OnDestroyTiles.Invoke(); //Camera Shake camShake.CameraShakeByInput(ShakeStrength, ShakeTimer); }
void RemoveTile(Tile tile) { //Change Color to Original Color tile.SetMaterialColor(tile.AttributeColor); tile.GroupIndex = 0; Tiles.Remove(tile); OnRemoveTile.Invoke(); }
public void DeseletSelectedTiles() { int count = Tiles.Count; for (int i = 0; i < count; i++) { RemoveTile(Tiles.First()); } SelectedTileType.Clear(); OnDeselectTiles.Invoke(); OnTileRelease(null); }
/// <summary> /// Listen to Tiles that need to relocation its location /// </summary> /// <param name="tile"></param> void ReachItsLocation(Tile tile) { tile.OnReachLocation.RemoveAllListeners(); calledEvent++; if (calledEvent == tilesToManualMove.Count) { tilesToManualMove.Clear(); calledEvent = 0; if (IsClearBoard == true) { OnRoundEnded(); cManager.OnCurrentRoundEnd.AddListener(TurnClearBoardOff); } //Start Combat OnEndBoardInteraction.Invoke(); } }
void AddTile(Tile tile) { //Change Color to SelectedColor tile.SetMaterialColor(HighlightCol); //Off Tile Animation TileAnimation tileAnim = tile.GetComponent <TileAnimation>(); if (tileAnim != null) { tileAnim.EnableFloating = false; } if (audioManager) { audioManager.PlaySFX("Tile_Select"); } Tiles.Add(tile); OnAddTile.Invoke(); }