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}"); }); }
public static IPromise Fire(SignalBus signalBus) { GetMultiplierSignal signal = new GetMultiplierSignal(); signalBus.Fire(signal); return(signal.FireInternal()); }
public void Execute(GetMultiplierSignal signal) { _gameplayApi.GetMultiplier() .Done(multiplier => { _rouletteModel.Multiplier = multiplier; signal.Resolve(); }, signal.Reject); }