Example #1
0
        public void HoldShape()
        {
            // Nothing is held, we can catch
            if (!_shapeHolder.GetHeldShape())
            {
                _shapeHolder.CatchShape(_currentlyActiveShape);

                _currentlyActiveShape = _spawner.SpawnShape();

                _soundManager.PlayHoldShapeSound();
            }
            else if (_shapeHolder.CanRelease)
            {
                Shape tempShape = _currentlyActiveShape;
                _currentlyActiveShape = _shapeHolder.ReleaseShape();
                _currentlyActiveShape.transform.position = _spawner.transform.position;
                _shapeHolder.CatchShape(tempShape);

                _soundManager.PlayHoldShapeSound();
            }
            else
            {
                _soundManager.PlayWrongMoveSound();
            }

            if (_ghostShape)
            {
                _ghostShape.ResetGhostShape();
            }
        }