Retrieving an Animation Clip (or any other asset) by string.

I have component that executes at the beginning of my scene/game that’s supposed to read an XML file, grab referenced Animation Clips and perform various "AddEvent"s on them with parameters tied to them. I’m unable to add said events via the Animator in the Editor, and due to the number of animations and events to be associated, it was quickly determined that setting it up so that this information was provided in the component’s inspector would become unmanageable, so having it all in a quick-to-edit and comment-able XML file feels like the way to go.

Is there a way to directly reference an animation clip (associated with an FBX file, and as Legacy) with a string? The one solution I have on hand is to make a ‘Dictionary’ in the inspector of the component that links each string to an AnimationClip, but if it’s possible to grab the clip’s instance with nothing but the string provided in the XML file, that’ll be even better.

Thanks in advance!

Hey guys, sorry to bump. The solution I went with above has been working so far, but I feel like there’s got to be a cleaner way to get it done, as I now have a giant list of Animations (which can’t be searched through, organized, or re-ordered with any kind of efficiency) with expandable “keyName” and “animationClip” fields. All so that I can point XML references to actual objects within Unity.

Essentially, all I want to be able to do is reference an Asset in Unity with a string in an XML TextAsset, so that I can run whatever processes I want to on it when the game starts. If this in itself is impossible, is there at least a prettier workaround than cramming references to every animation between every prefab that exists in the game in a single list ordered by date-of-entry (which will completely reset if I accidentally set the script on the ground too hard)?

I assume youve seen this?