void ImportBook(AdvImportBook book, AdvMacroManager macroManager) { foreach (var sheet in book.GridList) { ImportSheet(sheet, macroManager); } }
//アセットの取得 AdvImportBook GetAdvImportBookCreateIfMissing(string path) { //シナリオデータ用のスクリプタブルオブジェクトを宣言 string bookAssetPath = Path.ChangeExtension(path, BookAssetExt); AdvImportBook asset = UtageEditorToolKit.GetImportedAssetCreateIfMissing <AdvImportBook>(bookAssetPath); asset.hideFlags = HideFlags.NotEditable; return(asset); }
//ブックのインポート AdvImportBook ImportBook(StringGridDictionary book, string path) { //シナリオデータ用のスクリプタブルオブジェクトを宣言 string bookAssetPath = Path.ChangeExtension(path, BookAssetExt); AdvImportBook asset = UtageEditorToolKit.GetImportedAssetCreateIfMissing <AdvImportBook>(bookAssetPath); asset.hideFlags = HideFlags.NotEditable; asset.Clear(); foreach (var sheet in book.List) { asset.AddData(sheet.Grid); } //変更を反映 Debug.Log(LanguageAdvErrorMsg.LocalizeTextFormat(AdvErrorMsg.Import, bookAssetPath)); EditorUtility.SetDirty(asset); return(asset); }
//再インポートが必要なアセットを取得 bool CheckReimport(string path, out AdvImportBook bookAsset) { //シナリオデータ用のスクリプタブルオブジェクトを宣言 string bookAssetPath = Path.ChangeExtension(path, BookAssetExt); bookAsset = AssetDatabase.LoadAssetAtPath <AdvImportBook>(bookAssetPath); if (bookAsset == null) { //まだないので作る bookAsset = ScriptableObject.CreateInstance <AdvImportBook>(); AssetDatabase.CreateAsset(bookAsset, bookAssetPath); bookAsset.hideFlags = HideFlags.NotEditable; return(true); } else { return(CheckReimportFromPath(path)); } }