コード例 #1
0
ファイル: Map.cs プロジェクト: roadmageb/tetra-tower
    public void RemoveRowsIfFull(Tetromino tetromino)
    {
        bool[] rows = new bool[Map.gridHeight];

        foreach (Mino mino in tetromino.GetComponentsInChildren <Mino>())
        {
            var pos = mino.GetGridPosition();
            rows[pos.y] = true;
        }

        var isFull      = gridUtils.MakeIsFull();
        var isEmpty     = gridUtils.MakeIsEmpty();
        var shiftAmount = gridUtils.MakeShiftAmount(isFull, isEmpty);

        for (int i = 0; i < rows.Length; ++i)
        {
            if (rows[i] && isFull[i])
            {
                StartCoroutine(DebugDelete(isFull, shiftAmount));
                return;
            }
        }
    }