I have a script that I use on multiple GameObjects. It needs a property set to a sound file name. I have the names currently set in a static class as string properties so Config.Bell (for instance) would contain the actual path and file name.
Is there any way to define something such that I can assign an audioFile property to Config.Bell in the inspector? Is there an “eval” expression?
public static AudioSource SoundFile{ get {return soundFile; }}
[SerializeField] AudioSource soundFile;
I just woke up so i probably misunderstood, but is this what you want?
[QUOTE=I just woke up so i probably misunderstood, but is this what you want?[/QUOTE]
Appreciate the idea but not quite. In my example my object is an AudioClip but importantly it isn’t instantiated ahead of time it is simply loaded in Start() and the config file contains a string representing the path the file. I’ve pretty much concluded that setting values should be limited in inspector fields. There is no way to accommodate conditional settings for example. I’ll stick to code for things like this.[/QUOTE]