コード例 #1
0
            public override void OnStateEnter()
            {
                base.OnStateEnter();

                GetMultiplierSignal.Fire(SignalBus)
                .Done(() =>
                {
                    View.StartSpinning(Model.Multiplier);

                    Observable.Timer(TimeSpan.FromSeconds(Settings.SpinTime))
                    .Subscribe(l =>
                    {
                        View.StopSpinning(() =>
                        {
                            Model.RouletteState = ERouletteState.Result;
                        });
                    })
                    .AddTo(Disposables);
                },
                      exception =>
                {
                    // TODO: Do something...
                    Debug.LogError($"Error: Something went wrong. {exception}");
                });
            }
コード例 #2
0
        public static IPromise Fire(SignalBus signalBus)
        {
            GetMultiplierSignal signal = new GetMultiplierSignal();

            signalBus.Fire(signal);
            return(signal.FireInternal());
        }
コード例 #3
0
        public void Execute(GetMultiplierSignal signal)
        {
            _gameplayApi.GetMultiplier()
            .Done(multiplier =>
            {
                _rouletteModel.Multiplier = multiplier;

                signal.Resolve();
            },
                  signal.Reject);
        }