One parameter limit on animation event functions temporary?

Is the limitation on the number of parameters for animation event function calls (currently, only one parameter functions are exposed) temporary? I have several cases where multiple parameters would make my life much easier, and wondering if I should go ahead and work out hacks around this, or delay those for an update.

Reviving this for people like me who may stumble upon it on Google… Now (maybe also back then) you can pass an AnimationEvent in the function called by your animation event… Sounds funky I know…
The animation even is a collection of info and includes:

an int
a float
a string
and an object reference

After some testing it looks like Unity only allows AnimationEvent, int, float, and string. You cannot pass in an object reference as mentioned in another answer. That said, here are your options.

  1. The “easiest” solution at the moment for multiple parameters is to use an AnimationEvent, this is pretty inefficient if you need multiple ints, float, strings, or other complex data. Details: Unity - Scripting API: AnimationEvent
  2. Parse a string with multiple values separated by a comma (slow, messy, and error prone).
  3. Write individual functions for every event you need (circumventing params). Very messy for complex events.
  4. Use setters to alter the data in events, could result in a ton of events and more mess.

In short there is no good solution until Unity expands on the animation window’s serialization API. Best of luck.

I don't see any indication that this would be a temporary implementation. I think because the Animation Event can take an "Object Reference" as the parameter, this essentially allows you to pass any kind and amount of data you like.

Simply put the data into an array, or create your own custom class to contain the data and pass an instance of that. If that's what you were considering doing already, there's no need to think of it as a "hack" - it's common practice!

I don’t know if this is correct but what I did is create a MyAnimationEvents class, this class holds all of the event information I need (damage, radius, prefabs, names etc).
I made prefabs of all the various events which only have this script attached e.g.

animEventStandardAttack - damage = 1f, radius = 1f, particleSystem = blood, name = “standard”

animEventHeavyAttack - damage = 2f, radius = 2f, particleSystem = bigBlood, name = “heavy”

When I call the animation event, I pass in the prefab I want. The function instantiates the prefab, grabs the values from it and uses them as necessary. Heres the code I’m using in the animation event:

    public void DoDamage(GameObject animEventGO)
        MyAnimationEvent animEvent = GameObject.Instantiate(animEventGO).GetComponent<MyAnimationEvent>();
        if (animEvent.damage == 0) animEvent.damage = 1f;
        if (animEvent.radius == 0) animEvent.radius = 1f;

        MeleeWeapon wep = gameObject.GetComponent<Inventory>().equippedItem.GetComponent<MeleeWeapon>();
        wep.DoDamage(animEvent.damage, animEvent.radius);

Hope this helps someone!

Inspired by @Serinx answer, this is how I’m doing it now:

  1. Create an animation event class with the information you need
  2. Allow that class to be used to create assets out of it by adding [CreateAssetMenu (menuName = your_menu_name)] on top of its declaration
  3. Create as many animation events as you wish by right-clicking on your project and choosing the animation event from the corresponding menu
  4. On the script you have the event handler, you can now write something like this:

public void OnAnimationEvent(MyAnimationEvent animationEvent) { //Use it directly, without the need of instantiating }