//ファイルの読み込み public void Import(AdvScenarioDataProject project) { if (project.ChapterDataList.Count <= 0) { Debug.LogError("ChapterDataList is zeo"); return; } AssetFileManager.IsEditorErrorCheck = true; AdvCommand.IsEditorErrorCheck = true; AdvEngine engine = UtageEditorToolKit.FindComponentAllInTheScene <AdvEngine>(); if (engine != null) { engine.BootInitCustomCommand(); } this.scenarioDataTbl = new Dictionary <string, AdvScenarioData>(); this.macroManager = new AdvMacroManager(); AdvScenarioDataBuilderWindow.ProjectData.CreateScenariosIfMissing(); this.scenariosAsset = project.Scenarios; this.scenariosAsset.ClearOnImport(); //チャプターデータのインポート project.ChapterDataList.ForEach(x => ImportChapter(x.chapterName, x.ExcelPathList)); EditorUtility.SetDirty(this.scenariosAsset); AssetDatabase.Refresh(); AdvCommand.IsEditorErrorCheck = false; AssetFileManager.IsEditorErrorCheck = false; }
//ファイルの読み込み void ImportSub(AdvScenarioDataProject project) { Project = project; if (project.ChapterDataList.Count <= 0) { Debug.LogError("ChapterDataList is zeo"); return; } AssetFileManager.ClearCheckErrorInEditor(); AssetFileManager.IsEditorErrorCheck = true; AdvCommand.IsEditorErrorCheck = true; AdvCommand.IsEditorErrorCheckWaitType = project.CheckWaitType; UnityEngine.Profiling.Profiler.BeginSample("Import Scenarios"); AdvEngine engine = UtageEditorToolKit.FindComponentAllInTheScene <AdvEngine>(); if (engine != null) { engine.BootInitCustomCommand(); } this.scenarioDataTbl = new Dictionary <string, AdvScenarioData>(); this.macroManager = new AdvMacroManager(); AdvScenarioDataBuilderWindow.ProjectData.CreateScenariosIfMissing(); this.scenariosAsset = project.Scenarios; this.scenariosAsset.ClearOnImport(); //チャプターデータのインポート project.ChapterDataList.ForEach(x => ImportChapter(x.chapterName, x.ExcelPathList)); //ファイルが存在しているかチェック if (project.RecourceDir != null) { string path = new MainAssetInfo(project.RecourceDir).FullPath; AssetFileManager.CheckErrorInEditor(path, project.CheckExt); } UnityEngine.Profiling.Profiler.EndSample(); EditorUtility.SetDirty(this.scenariosAsset); AssetDatabase.Refresh(); AdvCommand.IsEditorErrorCheck = false; AdvCommand.IsEditorErrorCheckWaitType = false; AssetFileManager.IsEditorErrorCheck = false; }
//ファイルの読み込み public bool Import(List <string> pathList) { //対象のエクセルファイルを全て読み込み Dictionary <string, StringGridDictionary> bookDictionary = new Dictionary <string, StringGridDictionary>(); foreach (string path in pathList) { if (!string.IsNullOrEmpty(path)) { StringGridDictionary book = ExcelParser.Read(path); if (book.List.Count > 0) { bookDictionary.Add(path, book); } } } if (bookDictionary.Count <= 0) { return(false); } AdvEngine engine = UtageEditorToolKit.FindComponentAllInTheScene <AdvEngine>(); if (engine != null) { engine.BootInitCustomCommand(); } assetSetting = null; //設定データをインポート foreach (string path in bookDictionary.Keys) { ImportSettingBook(bookDictionary[path], path); if (assetSetting != null) { break; } } if (assetSetting == null) { return(false); } AssetFileManager.IsEditorErrorCheck = true; AdvCommand.IsEditorErrorCheck = true; GraphicInfo.CallbackExpression = assetSetting.DefaultParam.CalcExpressionBoolean; TextParser.CallbackCalcExpression = assetSetting.DefaultParam.CalcExpressionNotSetParam; iTweenData.CallbackGetValue = assetSetting.DefaultParam.GetParameter; //シナリオデータをインポート foreach (string path in bookDictionary.Keys) { ImportScenarioBook(bookDictionary[path], path); } GraphicInfo.CallbackExpression = null; TextParser.CallbackCalcExpression = null; iTweenData.CallbackGetValue = null; //シナリオラベルのリンクチェック ErroeCheckScenarioLabel(); AdvCommand.IsEditorErrorCheck = false; AssetFileManager.IsEditorErrorCheck = false; return(true); }