コード例 #1
0
ファイル: GameGrid.cs プロジェクト: Milswanca/AWSProject
    private void RecursiveFall(int _runningIndex, bool _countsAsChain = false)
    {
        GameBlock me = GetGameBlock(_runningIndex);

        if (!me)
        {
            return;
        }
        if (me.BlockState != EBlockState.BS_Idle)
        {
            return;
        }

        //If im grounded then return
        if (IsBlockBelow(_runningIndex))
        {
            return;
        }

        if (_countsAsChain)
        {
            blocksInChain.Add(playGrid[_runningIndex]);
        }

        me.Fall();

        //If theres a block above me, make that fall too
        RecursiveFall(_runningIndex + width, _countsAsChain);
    }