示例#1
0
        public override async UniTask <GameState> TickAsync(CancellationToken token)
        {
            _buttonContainerUseCase.ActivateButton(true);

            // ボタン入力待ち
            var input = await _buttonController.PushButton().ToUniTask(true, token);

            _buttonContainerUseCase.ActivateButton(false);

            switch (input)
            {
            case InputType.None:
                return(GameState.None);

            case InputType.MoveLeft:
            case InputType.MoveRight:
                await _stageObjectContainerUseCase.MoveAsync(input, token);

                break;

            case InputType.RotateLeft:
            case InputType.RotateRight:
                await(
                    _stageObjectContainerUseCase.RotateAsync(input, token),
                    _stageView.RotateAsync(input, token)
                    );
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            return(GameState.Move);
        }
示例#2
0
        private async UniTaskVoid LoadSceneAsync(GameType gameType, SceneName sceneName, int level, CancellationToken token)
        {
            // シーン遷移中にボタンを押下させない
            _buttonContainerUseCase.ActivateButton(false);
            _buttonContainerUseCase.ClearAllButton();

            OnBeginTransition(gameType, sceneName);

            await _transitionMaskView.FadeInAsync(token);

            await _zenjectSceneLoader.LoadSceneAsync(sceneName.ToString(), LoadSceneMode.Single, container =>
            {
                container.BindInstance(level);
                container.BindInstance(gameType);
            });

            // トランジションが完了するまでボタンを押下させない
            _buttonContainerUseCase.ActivateButton(false);

            await UniTask.Delay(TimeSpan.FromSeconds(CommonViewConfig.LOAD_INTERVAL), cancellationToken : token);

            await OnEndTransitionAsync(gameType, sceneName, token);

            _buttonContainerUseCase.ActivateButton(true);
        }