Unity Tip: Animation Curve Graphs
Recently I found out about a clever and helpful option when you need to visualize Unity data in a graph-like form in the editor.
Animation Curves:
Animation Curves are a feature of Unity commonly used for visualizing and creating animations with Unity’s inbuilt Animation system.
However, they can also be repurposed for a variety of uses outside of animation. For example, I made a dynamic flower mesh using Animation Curves for the length/width/height not long ago.
Animation Curves as a graph:
Animation Curves can also act as a visual graph which is populated at runtime with whatever numeric data values you want.
Creating the graph:
In any MonoBehaviour C# script, create a new Animation Curve variable. Animation Curves are a part of the UnityEngine namespace.
Now you can see that any numeric data can be added to this to make a convenient graph of points. This is a great and easy way to get a visual representation of your game data.