I am creating two animation states that is controlled by a bool condition. I am trying to programatically create everything because I plan to do create variations of this animator often.
// Create controller and hook up transitions.
var controller = AnimatorController.CreateAnimatorControllerAtPath(path);
var openState = GenerateTriggerableTransition(closeName, controller);
var closeState = GenerateTriggerableTransition(openName, controller);
// Add a transition property
controller.AddParameter("Open", AnimatorControllerParameterType.Bool);
// Add an any state transition
var transition = openState.AddTransition(closeState, false);
transition.AddCondition(AnimatorConditionMode.If, 1, "Open"); //this condition is Open = true
transition = closeState.AddTransition(openState, false);
transition.AddCondition(AnimatorConditionMode.If, -1, "Open"); //this condition is Open = true, but should be Open = false