예제 #1
0
        /// <summary>
        /// Переключение на следующую сцену
        /// </summary>
        internal void NextScene()
        {
            SceneNomer++;
            List <string> ScenesKeys = new List <string>();

            foreach (KeyValuePair <string, Scene> Sc in Scenes)
            {
                ScenesKeys.Add(Sc.Key);
            }
            if ((SceneNomer <= ScenesKeys.Count - 1) && (SceneNomer >= 0))
            {
                CurScene = Scenes[ScenesKeys[SceneNomer]];
                CurScene.GetComponent <Starter>().Start();
            }
            else if (SceneNomer > ScenesKeys.Count - 1)
            {
                End(true);
            }
        }
예제 #2
0
        private void Start()
        {
            if (IsAborted)
            {
                return;
            }
            CurLevelPassing = new LevelPassing()
            {
                DateAndTime = DateTime.Now.ToString()
            };
            LevelPassings.Add(CurLevelPassing);
            DBTools.Context.Entry(DbLevelRecord).State = System.Data.Entity.EntityState.Modified;
            DBTools.Context.SaveChanges();
            OnPropertyChanged("LevelPassingsCount");
            OnPropertyChanged("CardsCount");
            OnPropertyChanged("AvgCardsErrorsPercentInLast3LevelPassings");

            int id = DbLevelRecord.Id;
            var RefreshedDbLevelRecord = DBTools.Context.Levels.Find(id);

            if (RefreshedDbLevelRecord != null)
            {
                DbLevelRecord = RefreshedDbLevelRecord;
            }

            LoadMedia();
            LoadScenes();
            if (Settings.GetInstance().ShuffleMusic)
            {
                Game.Music.PlayRandom(Settings.GetInstance().RepeatMusicPlaylist);
            }
            else
            {
                Game.Music.PlayInOrder(Settings.GetInstance().RepeatMusicPlaylist);
            }
            Game.Music.Pause();

            CurScene.GetComponent <Starter>().Start();
            Game.Owner.AbortLevelButton.Visibility = Visibility.Visible;
        }