Exemplo n.º 1
0
        private void RegenerateEnumsFrom(DatabaseInputData DBInputData)
        {
            {
                Debug.Log("Generating Letters enums...");
                var parser = new LetterParser();
                parser.RegenerateEnums(DBInputData.letterDataAsset.text);
            }

            {
                Debug.Log("Generating Words enums...");
                var parser = new WordParser();
                parser.RegenerateEnums(DBInputData.wordDataAsset.text);
            }

            {
                Debug.Log("Generating Phrases enums...");
                var parser = new PhraseParser();
                parser.RegenerateEnums(DBInputData.phraseDataAsset.text);
            }

            {
                Debug.Log("Generating MiniGames enums...");
                var parser = new MiniGameParser();
                parser.RegenerateEnums(DBInputData.minigameDataAsset.text);
            }

            {
                Debug.Log("Generating PlaySessions enums...");
                var parser = new PlaySessionParser();
                parser.RegenerateEnums(DBInputData.playSessionDataAsset.text);
            }

            {
                Debug.Log("Generating LearningBlocks enums...");
                var parser = new LearningBlockParser();
                parser.RegenerateEnums(DBInputData.playSessionDataAsset.text);  // @note: LearningBlockParser works on the same table of playSessionData
            }

            {
                Debug.Log("Generating Localization enums...");
                var parser = new LocalizationParser();
                parser.RegenerateEnums(DBInputData.localizationDataAsset.text);
            }

            {
                Debug.Log("Generating Stages enums...");
                var parser = new StageParser();
                parser.RegenerateEnums(DBInputData.stageDataAsset.text);
            }

            {
                Debug.Log("Generating Rewards enums...");
                var parser = new RewardParser();
                parser.RegenerateEnums(DBInputData.rewardDataAsset.text);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Load input data and place it inside the database.
        /// </summary>
        /// <param name="DBInputData"></param>
        private void LoadDataFrom(DatabaseInputData DBInputData)
        {
            {
                Debug.Log("Loading Letters...");
                var parser = new LetterParser();
                parser.Parse(DBInputData.letterDataAsset.text, _databaseObject, _databaseObject.GetLetterTable());
            }

            {
                // @note: depends on Letter
                Debug.Log("Loading Words...");
                var parser = new WordParser();
                parser.Parse(DBInputData.wordDataAsset.text, _databaseObject, _databaseObject.GetWordTable());
            }

            {
                // @note: depends on Word
                Debug.Log("Loading Phrases...");
                var parser = new PhraseParser();
                parser.Parse(DBInputData.phraseDataAsset.text, _databaseObject, _databaseObject.GetPhraseTable());
            }

            {
                Debug.Log("Loading MiniGames...");
                var parser = new MiniGameParser();
                parser.Parse(DBInputData.minigameDataAsset.text, _databaseObject, _databaseObject.GetMiniGameTable());
            }

            {
                // @note: depends on Minigame
                Debug.Log("Loading PlaySessions...");
                var parser = new PlaySessionParser();
                parser.Parse(DBInputData.playSessionDataAsset.text, _databaseObject, _databaseObject.GetPlaySessionTable());
            }

            {
                // @note: depends on Letter, Word, Phrase, PlaySession
                Debug.Log("Loading LearningBlocks...");
                var parser = new LearningBlockParser();
                parser.Parse(DBInputData.playSessionDataAsset.text, _databaseObject, _databaseObject.GetLearningBlockTable());
            }

            {
                Debug.Log("Loading Localization...");
                var parser = new LocalizationParser();
                parser.Parse(DBInputData.localizationDataAsset.text, _databaseObject, _databaseObject.GetLocalizationTable());
            }

            {
                Debug.Log("Loading Stages...");
                var parser = new StageParser();
                parser.Parse(DBInputData.stageDataAsset.text, _databaseObject, _databaseObject.GetStageTable());
            }

            {
                Debug.Log("Loading Rewards...");
                var parser = new RewardParser();
                parser.Parse(DBInputData.rewardDataAsset.text, _databaseObject, _databaseObject.GetRewardTable());
            }

            // Save database modifications
            EditorUtility.SetDirty(_databaseObject.stageDb);
            EditorUtility.SetDirty(_databaseObject.minigameDb);
            EditorUtility.SetDirty(_databaseObject.rewardDb);
            EditorUtility.SetDirty(_databaseObject.letterDb);
            EditorUtility.SetDirty(_databaseObject.wordDb);
            EditorUtility.SetDirty(_databaseObject.phraseDb);
            EditorUtility.SetDirty(_databaseObject.localizationDb);
            EditorUtility.SetDirty(_databaseObject.learningblockDb);
            EditorUtility.SetDirty(_databaseObject.playsessionDb);
            AssetDatabase.SaveAssets();
        }