Hello there,
Thanks to a .NET plugin I found on the net, I’m reimplementing Unity sound system (AudioSource, DSPs, Spatialization etc. ) with FMOD for a personnal project.
To make the use of that custom system easier, I would like to create a new asset type (pretty much like AudioClip) which would define if the sound should be streamed or fully loaded, its length, its path etc. everything needed by my custom AudioSource to know what to do.
Is there a way I can do that in Unity ?
Thanks in advance for your answers 
Yes, you can. I’m not sure just how much you can do custom assets yet since I needed it for pretty basic stuff and can get away with Unity serializing the data for me.
Here’s some code to get you started in your research. I use these to create my custom .asset files.
/// <summary> will create the asset file if it does not exist and add the object and save the file</summary>
public static void AddObjectToAssetFile(Object obj, string assetFile)
{
if (!RelativeFileExist(assetFile))
{
AssetDatabase.CreateAsset(obj, assetFile);
}
else
{
AssetDatabase.AddObjectToAsset(obj, assetFile);
AssetDatabase.ImportAsset(assetFile); // force a save
}
}
/// <summary>
/// will create a new asset of the type, save it and return a reference to it.
/// assetFile should be a relative path to the file to store the new asset in
/// if createNewIfExist then a unique name will be generated if the file allready
/// exist and the asset will be saved there
/// </summary>
public static UnityEngine.Object CreateAsset(System.Type type, string objectName, string assetFile, bool createNewIfExist)
{
Object obj = ScriptableObject.CreateInstance(type);
obj.name = objectName;
if (!RelativeFileExist(assetFile))
{
AssetDatabase.CreateAsset(obj, assetFile);
}
else
{
if (createNewIfExist)
{
string fn = AssetDatabase.GenerateUniqueAssetPath(assetFile);
AssetDatabase.CreateAsset(obj, fn);
}
else
{
AssetDatabase.AddObjectToAsset(obj, assetFile);
AssetDatabase.ImportAsset(assetFile); // force a save
}
}
return obj;
}
To use it I do something like this. Attribute is a class that is derived from ScriptableObject and contains a bunch of public variables that can be serialized/ deserialized by unity.
curr = ScriptableObject.CreateInstance<Attribute>();
SomeClassName.AddObjectToAssetFile(curr, "Assets/SomeData/Attributes.asset");
That is how I create/save my custom assets.
Have a look AssetDatabase to see how you can load 'em or simply save a reference like you would a prefab, if that is possible.