Exemplo n.º 1
0
        private void Start()
        {
            _blockInitializer = GetComponent <BlockInitializer>();
            _gridManager      = _blockInitializer.GridManager;
            _grid             = _gridManager.Grid;
            var currentShape = _blockInitializer.CurrentShape;

            var spawnGridPointX = (_grid.Dimensions.x - currentShape.Size.x) / 2;

            _gridCoordinate = new Vector2Int(spawnGridPointX, 0);

            if (_gridManager.CheckIfGameOver(_gridCoordinate, currentShape))
            {
                GameOverSignal.Dispatch();
            }
            UpdatePosition();

            ShapeVerticalMoveSignal.AddListener(ShiftVertical);
            ShapeHorizontalMoveSignal.AddListener(ShiftHorizontal);
            ShapeRotateSignal.AddListener(ShiftRotate);
        }