Just wondering if this is an “o.k” thing to do and will not mess with the Unity project?
Are there any issues with doing this?
I wanted to use it to store per-project default settings for an AssetPostprocessor class I’m making. i.e:
[ System.Serializable ]
public class TextureAtlasImportSettings : ScriptableObject {
/// data goes here
public static TextureAtlasImportSettings GetDefaultTextureAtlasImportSettings()
{
string libraryPath = System.IO.Path.GetDirectoryName( Application.dataPath )
+ "/Library/";
string settingsPath = libraryPath+"DefaultTextureAtlasImportSettings.asset";
TextureAtlasImportSettings settings = (TextureAtlasImportSettings)
AssetDatabase.LoadAssetAtPath(
settingsPath,
typeof(TextureAtlasImportSettings)
);
if ( settings == null ) {
settings = CreateInstance<TextureAtlasImportSettings>();
settings.name = "DefaultTextureAtlasImportSettings";
AssetDatabase.CreateAsset( settings,settingsPath );
}
return settings;
}
}