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
ModelAnimatorParameterCreator
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
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
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
Returns