Exemplo n.º 1
0
        public override void OnRegister()
        {
            base.OnRegister();

            ShapeVerticalMoveSignal.AddListener(ShapeMoveCallback);
            ScoreChangedSignal.AddListener(ScoreChangedCallback);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
 public void DispatchVerticalMove(int v) => ShapeVerticalMoveSignal.Dispatch(v);
Exemplo n.º 4
0
 private void OnDestroy()
 {
     ShapeVerticalMoveSignal.RemoveListener(ShiftVertical);
     ShapeHorizontalMoveSignal.RemoveListener(ShiftHorizontal);
     ShapeRotateSignal.RemoveListener(ShiftRotate);
 }