/// <summary> /// Create .asset file for excel setting. /// </summary> public static ExcelSettings Create() { string filePath = CustomAssetUtility.GetUniqueAssetPathNameOrFallback(AssetFileName); s_Instance = (ExcelSettings)AssetDatabase.LoadAssetAtPath(filePath, typeof(ExcelSettings)); if (s_Instance == null) { s_Instance = CreateInstance <ExcelSettings>(); string path = CustomAssetUtility.GetUniqueAssetPathNameOrFallback(AssetFileName); AssetDatabase.CreateAsset(s_Instance, path); ExcelSettings.AssetPath = Path.GetDirectoryName(path); ExcelSettings.AssetPath += "/"; // saves file path of the created asset. EditorUtility.SetDirty(s_Instance); AssetDatabase.SaveAssets(); EditorUtility.DisplayDialog( "Validate Settings", "Default excel settings file has been created for accessing excel spreadsheet. Set valid runtime editor paths before proceeding.", "OK" ); } else { Debug.LogWarning("Already exist at " + filePath); } Selection.activeObject = s_Instance; return(s_Instance); }
public static void CreateExcelSetting() { ExcelSettings.Create(); }
public void OnEnable() { setting = target as ExcelSettings; }