コード例 #1
0
ファイル: GameLoop.cs プロジェクト: EllmoRivetti/TrickyTowers
    void OnTouchGround(object sender, EventArgs e)
    {
        TetrisBlock block = sender as TetrisBlock;

        block.TouchGround -= OnTouchGround;
        isCurrentBlock     = false;

        if (block.transform.position.y + 17 > score) // Harcoded value to create a coherent score (pas fou je sais)
        {
            this.score = (int)block.transform.position.y + 17;
            CheckScoreForPowerUp();
        }
        if (chains)
        {
            chains = false;
            if (block.GetIdList().Count > 0)
            {
                powerUp.ActivateChains(block.gameObject, blockList, block.GetIdList());
            }
        }
        if (bricks)
        {
            bricks = false;
            powerUp.ActiveBrick(block.gameObject);
        }
        lastBlock = block.gameObject;
        Spawn();
    }