Exemplo n.º 1
0
        //マクロ処理したインポートデータを作成する
        void ImportChapter(string chapterName, List <AdvImportBook> books, bool checkTextCount)
        {
            //シナリオアセットに各ブックのアセットを設定
            AdvChapterData        chapter = this.scenariosAsset.AddImportData(chapterName, books);
            AdvSettingDataManager setting = new AdvSettingDataManager();

            setting.ImportedScenarios = this.scenariosAsset;
            chapter.MakeSettingImportData(this.macroManager);
            setting.BootInit("");
            chapter.MakeScenarioImportData(setting, this.macroManager);
            AdvGraphicInfo.CallbackExpression = setting.DefaultParam.CalcExpressionBoolean;
            TextParser.CallbackCalcExpression = setting.DefaultParam.CalcExpressionNotSetParam;
            iTweenData.CallbackGetValue       = setting.DefaultParam.GetParameter;

            List <AdvScenarioData> scenarioList = new List <AdvScenarioData>();

            foreach (var book in books)
            {
                foreach (var grid in book.ImportGridList)
                {
                    string sheetName = grid.SheetName;
                    if (!AdvSheetParser.IsScenarioSheet(sheetName))
                    {
                        continue;
                    }
                    if (scenarioDataTbl.ContainsKey(sheetName))
                    {
                        Debug.LogError(sheetName + " is already contains in the sheets");
                    }
                    else
                    {
                        AdvScenarioData scenario = new AdvScenarioData(grid);
                        scenarioDataTbl.Add(sheetName, scenario);
                        scenarioList.Add(scenario);
                    }
                }
            }

            //シナリオデータとして解析、初期化
            foreach (AdvScenarioData data in scenarioList)
            {
                data.Init(setting);
            }

            AdvGraphicInfo.CallbackExpression = null;
            TextParser.CallbackCalcExpression = null;
            iTweenData.CallbackGetValue       = null;

            //シナリオラベルのリンクチェック
            ErrorCheckScenarioLabel(scenarioList);

            //文字数カウント
            if (checkTextCount)
            {
                CheckCharacterCount(scenarioList);
            }
        }
Exemplo n.º 2
0
 //マクロを適用したインポートデータを作成
 public void MakeImportData(AdvSettingDataManager dataManager, AdvMacroManager macroManager)
 {
     Profiler.BeginSample("MakeImportData");
     foreach (var grid in GridList)
     {
         string sheetName = grid.SheetName;
         if (sheetName.Contains("."))
         {
             Debug.LogErrorFormat("Don't use '.' to sheetname in  {0}", grid.Name);
         }
         if (AdvSheetParser.IsScenarioSheet(sheetName) && !AdvMacroManager.IsMacroName(sheetName))
         {
             importGridList.Add(new AdvImportScenarioSheet(grid, dataManager, macroManager));
         }
     }
     Profiler.EndSample();
     Reimport = false;
 }
Exemplo n.º 3
0
        //マクロ処理したインポートデータを作成する
        void ImportChapter(string chapterName, List <AdvImportBook> books)
        {
            //チャプターデータを作成し、各シナリオを設定
            string path = AssetDatabase.GetAssetPath(this.Project);

            path = FilePathUtil.Combine(FilePathUtil.GetDirectoryPath(path), chapterName);
            AdvChapterData chapter = LoadOrCreateChapterAsset(path);

            this.scenariosAsset.AddChapter(chapter);

            //初期化
            chapter.ImportBooks(books, this.macroManager);

            //設定データの解析とインポート
            AdvSettingDataManager setting = new AdvSettingDataManager();

            setting.ImportedScenarios = this.scenariosAsset;
            setting.BootInit("");
            chapter.MakeScenarioImportData(setting, this.macroManager);
            EditorUtility.SetDirty(chapter);
            AdvGraphicInfo.CallbackExpression = setting.DefaultParam.CalcExpressionBoolean;
            TextParser.CallbackCalcExpression = setting.DefaultParam.CalcExpressionNotSetParam;
            iTweenData.CallbackGetValue       = setting.DefaultParam.GetParameter;

            List <AdvScenarioData> scenarioList = new List <AdvScenarioData>();

            foreach (var book in books)
            {
                foreach (var grid in book.ImportGridList)
                {
                    grid.InitLink();
                    string sheetName = grid.SheetName;
                    if (!AdvSheetParser.IsScenarioSheet(sheetName))
                    {
                        continue;
                    }
                    if (scenarioDataTbl.ContainsKey(sheetName))
                    {
                        Debug.LogError(sheetName + " is already contains in the sheets");
                    }
                    else
                    {
                        AdvScenarioData scenario = new AdvScenarioData(grid);
                        scenarioDataTbl.Add(sheetName, scenario);
                        scenarioList.Add(scenario);
                    }
                }
            }

            //シナリオデータとして解析、初期化
            foreach (AdvScenarioData data in scenarioList)
            {
                data.Init(setting);
            }

            AdvGraphicInfo.CallbackExpression = null;
            TextParser.CallbackCalcExpression = null;
            iTweenData.CallbackGetValue       = null;

            //シナリオラベルのリンクチェック
            ErrorCheckScenarioLabel(scenarioList);

            //文字数カウント
            if (Project.CheckTextCount)
            {
                CheckCharacterCount(scenarioList);
            }
        }