Beispiel #1
0
        public void EnableScroll()
        {
            if (_scrollEnabled)
            {
                DisableScroll();
                return;
            }

            _navigation.Hide();

            var puzzleState = _levels[_selectedLevel].GetComponent <PuzzleState>();
            var puzzleScale = puzzleState.GetComponent <PuzzleScale>();
            var boardAction = puzzleState.GetComponent <BoardAction>();

            puzzleState.BoardEnabled = false;

            RevealLevels(_selectedLevel);

            puzzleScale.PuzzleInit        -= OnPuzzleInit;
            boardAction.PuzzleWin         -= OnPuzzleWin;
            puzzleState.LevelStateChanged -= OnLevelStateChanged;

            var zoom = CameraScript.CameraZoomToFit(puzzleScale.Dimensions, puzzleScale.Margin, _scaleRatio);

            _cameraZoomId = CameraScript.ZoomCamera(zoom, CameraZoomTime, LeanTweenType.easeInSine);

            _panVelocity   = Vector3.up / VelocityScalingFactor;
            _scrollEnabled = true;

            // TODO: make configurable
            const float volume = 0.3f;

            _gameAudio.Play(GameClip.MenuSelect, volume: volume);

            var puzzleInfo = puzzleState.GetComponentInChildren <PuzzleInfo>();

            puzzleInfo.Show();
        }