示例#1
0
    IEnumerator fallingGap()
    {
        yield return(new WaitForSeconds(fallingSpeed));

        //If reach the bottom, create new puyo
        if (PuyoController.reachBottom((int)controlMainPuyo.getPosition().x, (int)controlMainPuyo.getPosition().y) ||
            PuyoController.reachBottom((int)controlSubPuyo.getPosition().x, (int)controlSubPuyo.getPosition().y))
        {
            if (PuyoController.isGameOver())
            {
                gameOverObj.SetActive(true);
                gameStatus = GameStatus.GamePause;
            }
            else
            {
                int mainX = (int)controlMainPuyo.getPosition().x;
                int mainY = (int)controlMainPuyo.getPosition().y;
                int subX  = (int)controlSubPuyo.getPosition().x;
                int subY  = (int)controlSubPuyo.getPosition().y;
                puyoArr[mainX, mainY] = controlMainPuyo;
                puyoArr[subX, subY]   = controlSubPuyo;

                gameStatus = GameStatus.PuyoArranging;
            }
        }
        else
        {
            PuyoController.puyoDown(true);
        }
        falling = true;
    }