예제 #1
0
        void CheckForLMVPointEvents()
        {
            var pointsGained = 0;
            var lmvSettings  = Settings.BibaPointSettings.Where(setting => setting is BibaLMVPointEvent);

            foreach (BibaLMVPointEvent setting in lmvSettings)
            {
                if (!BibaProfile.BibaProfileSession.CompletedLMVScoreEvents.Contains(setting.Id) || setting.Repeat)
                {
                    if (BibaProfile.BibaProfileSession.LMVSessionDict [setting.LMVScoreType].SessionScore >= setting.ScoreRequired)
                    {
                        BibaProfile.Points += setting.Points;
                        if (!BibaProfile.BibaProfileSession.CompletedLMVScoreEvents.Contains(setting.Id))
                        {
                            BibaProfile.BibaProfileSession.CompletedLMVScoreEvents.Add(setting.Id);
                        }
                    }
                }
            }

            if (pointsGained > 0)
            {
                DataService.Save();
                PointsGainedSignal.Dispatch(pointsGained, BibaProfile.Points);
            }
        }
예제 #2
0
        public override void OnRegister()
        {
            PointsPopupView.PlayBibaSFXLoopSignal  = PlayBibaSFXLoopSignal;
            PointsPopupView.StopBibaSFXLoopsSignal = StopBibaSFXLoopsSignal;

            PointsGainedSignal.AddListener(PlayPointsAnimation);
            ResetGameModelSignal.AddListener(ResetPoints);
        }
예제 #3
0
        public void CheckAndCompletePointEvent(string keyToCheck)
        {
            var setting = Settings.BibaPointSettings.Find(sett => sett.Id == keyToCheck);

            if (setting == null)
            {
                return;
            }

            if (!BibaProfile.CompletedPointEvents.Contains(keyToCheck) || setting.Repeat)
            {
                BibaProfile.Points += setting.Points;
                if (!BibaProfile.CompletedPointEvents.Contains(keyToCheck))
                {
                    BibaProfile.CompletedPointEvents.Add(keyToCheck);
                }

                DataService.Save();
                PointsGainedSignal.Dispatch(setting.Points, BibaProfile.Points);
            }

            CheckForLMVPointEvents();
        }
예제 #4
0
 public override void OnRemove()
 {
     PointsGainedSignal.RemoveListener(PlayPointsAnimation);
     ResetGameModelSignal.RemoveListener(ResetPoints);
 }