Esempio n. 1
0
        public void PlayContents(IEventContents eventContentes)
        {
            Debug.Assert(this.currentEventContents != null, "currentEventContentsがありません");
            this.currentEventContents.OnExit();

            // 終わった段階で終了状態にする
            if (this.currentEventContents.TargetPlayerEventModel != null)
            {
                this.currentEventContents.TargetPlayerEventModel.ToDone();
                playerEventRepository.Store(this.currentEventContents.TargetPlayerEventModel);
            }

            // 報酬がなければ次のイベントに移動する
            if (this.currentEventContents.TargetPlayerEventModel == null)
            {
                this.currentEventContents = eventContentes;
                eventContentes.OnEnter();
                return;
            }

            // 報酬の受け取り
            this.currentEventContentsExecuterState = EventContentsExecuterState.RewardReceive;
            var receiveReceiver = new RewardReceiver(this.currentEventContents.TargetPlayerEventModel);

            receiveReceiver.OnEndReceiveObservable.Subscribe(_ => {
                //報酬受取の終わったタイミングで次のイベントを起動する
                this.currentEventContentsExecuterState = EventContentsExecuterState.ContentsPlaying;
                this.currentEventContents = eventContentes;
                eventContentes.OnEnter();
            });
            receiveReceiver.ReceiveRewardAndShowModel();
        }
Esempio n. 2
0
 public ReceiveRewardMode(RewardModel rewardModel)
 {
     this.receiveRewardDisposable = null;
     this.rewardModel             = rewardModel;
     this.rewardReceiver          = new RewardReceiver(this.rewardModel);
 }