Binding animator parameters
This isn't really a problem question. I'm just trying to understand unity3d a little better.
In the unity editor, you can see the public variables for components in the animation editor window. However, in the animator editor window (for your animator controllers), you have to specify parameters.
I don't know if this is general practice for programming, but I prefer to consolidate variables to ensure there's no discrepancy between values in code. To achieve this, I often do this:
public float diff {
get { return animator.GetFloat( "diff" ); }
set { animator.SetFloat( "diff", value ); }
}
That ensures I can have one "diff" variable in this scenario. It could be any value or type (respective Animator methods, ofc.).
Now, if your using the unity editor, you'll find that you can't even build animator controllers or animations until you have a game object selected. You can't change component variables in an animation without a target component to play with. The animation editor window let's you control component variables, and the animator controller only let's you control specific variables.
What I'm asking is this: Why were animators controllers exception to this same pattern of variables/parameters? Wouldn't it be better if the animator controller just derived variables directly from scripts the same way animations do?