public static void SpreadSheetUndo(GoogleSpreadSheetConfig spreadSheet, string text) { if (spreadSheet != null) { Undo.RecordObject(spreadSheet, text); } }
public static void CreateConverter(int selectedType, string converterName, GoogleSpreadSheetConfig parentConfig) { if (selectedType < 0 || selectedType >= ConverterType.Count) { return; } var type = ConverterType[selectedType]; FileUtility.CreateSpreadSheetConverter(type, converterName, parentConfig); }
public static void CreateSpreadSheetConverter(Type converterType, string converterName, GoogleSpreadSheetConfig parentConfig) { if (!Directory.Exists(SaveDataDirectoryPath)) { Directory.CreateDirectory(SaveDataDirectoryPath); } var saveData = ScriptableObject.CreateInstance(converterType) as GoogleSpreadSheetConverter; saveData.ConverterName = converterName; saveData.name = converterName; saveData.ScriptName = converterType.Name; parentConfig.Converter.Add(saveData); AssetDatabase.AddObjectToAsset(saveData, AssetDatabase.GetAssetPath(parentConfig)); AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(parentConfig)); AssetDatabase.Refresh(); AssetDatabase.SaveAssets(); }
public void Initialize(GoogleSpreadSheetConfig parent) { selectedType = 0; parentConfig = parent; ConverterEditorUtility.GetConverterSubClass(); }