logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class ModelAnimatorParameterCreator

    Adds, renames and deletes UnityEditor.Animations.AnimatorController parameters against an already-created controller asset. Split out of ModelAnimatorCreator once state ops plus parameter and transition ops would have pushed that file well past its ~600-line size guidance — parameters are their own authoring surface (controller-wide, not layer/state-scoped) with a DRY concern of their own: a rename or a delete both need to walk every transition condition across every layer and sub-state-machine looking for the parameter, so that walk lives here once instead of twice. Reuses ModelAnimatorCreator.StateOperationResult and its controller-load/undo/save plumbing (Serenity.Editor.AnimationHub.Authoring.ModelAnimatorCreator.ExecuteControllerOperation(System.String,System.String,System.Func{UnityEditor.Animations.AnimatorController,System.String})) rather than duplicating a sibling DTO.

    Inheritance
    object
    ModelAnimatorParameterCreator
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Editor.AnimationHub.Authoring
    Assembly: Serenity.AnimationHub.Editor.dll
    Syntax
    public static class ModelAnimatorParameterCreator

    Methods

    AddParameter(string, string, AnimatorControllerParameterType)

    Declares a new parameter. Rejected (result carries the error, no exception escapes) when one of that name already exists.

    Declaration
    public static ModelAnimatorCreator.StateOperationResult AddParameter(string controllerAssetPath, string parameterName, AnimatorControllerParameterType parameterType)
    Parameters
    Type Name Description
    string controllerAssetPath
    string parameterName
    AnimatorControllerParameterType parameterType
    Returns
    Type Description
    ModelAnimatorCreator.StateOperationResult

    DeleteParameter(string, string)

    Deletes a parameter. Rejected — naming every still-referencing transition — when any transition condition anywhere in the controller still reads it; deletion is only for parameters the validator already reports as unused.

    Declaration
    public static ModelAnimatorCreator.StateOperationResult DeleteParameter(string controllerAssetPath, string parameterName)
    Parameters
    Type Name Description
    string controllerAssetPath
    string parameterName
    Returns
    Type Description
    ModelAnimatorCreator.StateOperationResult

    RenameParameter(string, string, string)

    Renames a parameter and rewrites every transition condition across every layer and sub-state-machine that reads it, so no condition is left pointing at a name that no longer exists.

    Declaration
    public static ModelAnimatorCreator.StateOperationResult RenameParameter(string controllerAssetPath, string oldName, string newName)
    Parameters
    Type Name Description
    string controllerAssetPath
    string oldName
    string newName
    Returns
    Type Description
    ModelAnimatorCreator.StateOperationResult
    In this article
    © 2026 Serenity. All Rights Reserved