UnityEditor.Animations.AnimatorTransitionBase.AddCondition C# (CSharp) Method

AddCondition() public method

Utility function to add a condition to a transition.

public AddCondition ( AnimatorConditionMode mode, float threshold, string parameter ) : void
mode AnimatorConditionMode The Animations.AnimatorCondition mode of the condition.
threshold float The threshold value of the condition.
parameter string The name of the parameter.
return void
        public void AddCondition(AnimatorConditionMode mode, float threshold, string parameter)
        {
            this.undoHandler.DoUndo(this, "Condition added");
            AnimatorCondition[] conditions = this.conditions;
            AnimatorCondition item = new AnimatorCondition {
                mode = mode,
                parameter = parameter,
                threshold = threshold
            };
            ArrayUtility.Add<AnimatorCondition>(ref conditions, item);
            this.conditions = conditions;
        }