How to animate properties stored in arrays?

I created a script that has an array of Rects and i want to animate them in the Animation window.

Something like

public class Hitbox : MonoBehaviour
{
    public Rect[] rect;
}

I have another script that draws the Hitbox on the SceneView, the thing is that Unity doesn’t seem to support arrays in the Animation window when i try to add a new curve, the only property that is shown to me is the Enabled property, is there any way to solve this?

You could make a Rect-like class extend Monobehaviour and add multiple copies of it to your GameObject as needed. Each copy will show up at the Animation window. In the script you had the array of Rects, populate it with GetComponents() and now you should be cool =)

On solution is to store the data in children gameobject, and use GetComponentsInChildren to retrieve it when you need it