So, basically I have an editor, which allows me to save a file, where one of the fields is a string which is the name of an audioclip, during editor mode I am able to use Resource.FindObjectOfTypeAll and locate the audio clip by name this way, however while in-game, that method does not work, basically I am trying to find a way that’d work both ways. Please, can I get some help asap?
Just use Resources.Load. You need to have your audio assets under a Resources hierarchy, i.e. inside folder (or a sub-folder whose parent is) named “Resources”.
At runtime use the path:
Resources.Load("myClip"); // if your clip is directly under a 'Ressources' folder
Resources.Load("folderName/subFolder/myClip"); // if your clip is in a sub-folder which path is "Resources/folderName/subFolder".
During editing, just save the path as a string.