Exemplo n.º 1
0
    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);
    }
Exemplo n.º 2
0
    void RemoveTile(Tile tile)
    {
        //Change Color to Original Color
        tile.SetMaterialColor(tile.AttributeColor);
        tile.GroupIndex = 0;

        Tiles.Remove(tile);

        OnRemoveTile.Invoke();
    }
Exemplo n.º 3
0
    public void DeseletSelectedTiles()
    {
        int count = Tiles.Count;

        for (int i = 0; i < count; i++)
        {
            RemoveTile(Tiles.First());
        }

        SelectedTileType.Clear();

        OnDeselectTiles.Invoke();

        OnTileRelease(null);
    }
Exemplo n.º 4
0
    /// <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();
        }
    }
Exemplo n.º 5
0
    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();
    }