コード例 #1
0
    public void GenerateTiles(GetPrefabsDelegate getPrefabs, TileAnimParams animParams)
    {
        DropPiece = new DropPieceSimple();
        DropPiece.Reset(true, DropPieceSimple.RandomCell);

        var pfTransform = GameObject.Find("Playfield").transform;

        for (var c = 0; c < NumColumns; c++)
        {
            for (var r = 0; r < NumRows; r++)
            {
                var        cell = DropPiece.Cells[c][r];
                GameObject prefab = null, adornment = null;
                Transform  transform = null;
                getPrefabs(cell, out prefab, out adornment, out transform);
                var tile = new Tile();
                tile.Instantiate(prefab, adornment, Vector3.zero, transform, animParams);
                _tiles[c, r] = tile;
            }
        }
    }
コード例 #2
0
ファイル: DropPiece.cs プロジェクト: kelleyma49/blockin-beats
        public void Reset(PlayfieldPoint pos, bool allowJewel, DropPieceSimple.GetCellState del = null)
        {
            DropPieceSimple = new DropPieceSimple();

            if (del == null)
            {
                del = DropPieceSimple.RandomCell;
            }

            for (var x = 0; x < NumColumns; x++)
            {
                Positions[x].Column = pos.Column + x;
                Positions[x].Row    = pos.Row;
            }

            DropPieceSimple.Reset(allowJewel, del);

            CurrentState = State.Whole;
            HoldTimer    = HoldTime;
            FastDrop     = false;
        }