Variable Type for Asset Files?

Hi guys,

I am looking for a variable type which would allow me to store any type of Asset File (Texture, AudioClip, etc.)

My number one choice is using UnityEngine.Object, however, it’s impossible to serialize like GameObject.

Any ideas?

Thanks! :smile:

The short answer is “generics”…

Unfortunately Unity doesn’t serialize generic fields. Depending on what you’re trying to do, you can either trick Unity into being helpful via subclassing or you can dive in and write your own serializer.