Beispiel #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);
            }
        }
        void AddFileDataToTsv(StringGrid grid, int version, string excelFileName, string sheetName)
        {
            const string format = "{0}/Settings/{1}.tsv";
            string       tag    = AdvSheetParser.ToBootTsvTagName(sheetName);

            grid.AddRow(new List <string> {
                tag, string.Format(format, excelFileName, sheetName), "" + version
            });
        }
Beispiel #3
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;
 }
        void ImportSheet(StringGrid sheet, AdvMacroManager macroManager)
        {
            sheet.InitLink();
            string sheetName = sheet.SheetName;

            if (AdvSheetParser.IsDisableSheetName(sheetName))
            {
                Debug.LogError(sheetName + " is invalid name");
                return;
            }

            if (AdvSheetParser.IsSettingsSheet(sheetName))
            {
                SettingList.Add(sheet);
            }
            else
            {
                macroManager.TryAddMacroData(sheet.SheetName, sheet);
            }
        }
Beispiel #5
0
 //起動時初期化
 public void BootInit(AdvSettingDataManager settingDataManager)
 {
     IsInited = true;
     //設定データの初期化
     foreach (var grid in settingList)
     {
         IAdvSetting data = AdvSheetParser.FindSettingData(settingDataManager, grid.SheetName);
         if (data != null)
         {
             data.ParseGrid(grid);
         }
     }
     foreach (var grid in settingList)
     {
         IAdvSetting data = AdvSheetParser.FindSettingData(settingDataManager, grid.SheetName);
         if (data != null)
         {
             data.BootInit(settingDataManager);
         }
     }
 }
            internal bool TryConvertToCsv(int version)
            {
                foreach (var sheet in sheets.List)
                {
                    if (AdvSheetParser.IsSettingsSheet(sheet.Grid.SheetName))
                    {
                        SettingsSheets.Add(sheet.Grid);
                        CsvList.Add(new CsvInfo(sheet.Grid, this.Name + "/Settings/" + sheet.Key));
                    }
                    else
                    {
                        ScenarioSheets.Add(sheet.Grid);
                        CsvList.Add(new CsvInfo(sheet.Grid, this.Name + "/Scenario/" + sheet.Key));
                    }
                }

                //シナリオ設定シートは個別にコンバート
                CsvList.Add(new CsvInfo(MakeScenarioSettingGrid(version), this.Name + "/Settings/" + AdvSheetParser.SheetNameScenario));
                return(true);
                ///起動用CSVをコンバート
//				csvInfoList.Add(ConvertBootSetting(version));
            }
Beispiel #7
0
        public void MakeSettingImportData(AdvMacroManager macroManager)
        {
            foreach (var book in DataList)
            {
                foreach (var sheet in book.GridList)
                {
                    string sheetName = sheet.SheetName;
                    if (AdvSheetParser.IsDisableSheetName(sheetName))
                    {
                        Debug.LogError(sheetName + " is invalid name");
                        continue;
                    }

                    if (AdvSheetParser.IsSettingsSheet(sheetName))
                    {
                        settingList.Add(sheet);
                    }
                    else
                    {
                        macroManager.TryAddMacroData(sheet.SheetName, sheet);
                    }
                }
            }
        }
Beispiel #8
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);
            }
        }