Class ProceduralAnimatorTargetBinder
Resolves a ProceduralAnimatorProfileSO's material and transform target mappings against a live hierarchy and registers the resolved targets with the appliers that drive them.
Inherited Members
Namespace: Serenity.ProceduralAnimator.Infrastructure.Services
Assembly: Serenity.UnityProceduralAnimator.Infrastructure.dll
Syntax
public sealed class ProceduralAnimatorTargetBinder
Remarks
Extracted from ProceduralAnimatorComponent, which resolved the same shader colour property and
cached the same original colour through two independent copies of the logic — one for profile-authored
targets and one for the runtime RegisterMaterialTarget entry point. Both now go through
RegisterMaterialColorTarget(string, Renderer, int). Logging arrives as two callbacks rather than a resolved
ILogService so the binder stays constructible in a test without a service locator, and so the
component keeps owning its own log category and message prefix.
Constructors
ProceduralAnimatorTargetBinder(UnityMaterialApplier, UnityTransformApplier, Action<string>, Action<string>)
Declaration
public ProceduralAnimatorTargetBinder(UnityMaterialApplier materialApplier, UnityTransformApplier transformApplier, Action<string> logInformation, Action<string> logWarning)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityMaterialApplier | materialApplier | |
| UnityTransformApplier | transformApplier | |
| Action<string> | logInformation | |
| Action<string> | logWarning |
Methods
RegisterMaterialColorTarget(string, Renderer, int)
Resolves the animatable colour property on the renderer's material at the given index and registers it with the material applier. Logs nothing on success: the runtime registration path runs on every pooled spawn, where a per-call information log caused log bursts that hitched gameplay frames.
Declaration
public bool RegisterMaterialColorTarget(string materialId, Renderer renderer, int materialIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| string | materialId | |
| Renderer | renderer | |
| int | materialIndex |
Returns
| Type | Description |
|---|---|
| bool | True when the target was registered. |
RegisterMaterialTargets(ProceduralAnimatorProfileSO, Transform)
Registers every valid material target the profile declares, resolving each renderer relative to
hierarchyRoot.
Declaration
public int RegisterMaterialTargets(ProceduralAnimatorProfileSO profile, Transform hierarchyRoot)
Parameters
| Type | Name | Description |
|---|---|---|
| ProceduralAnimatorProfileSO | profile | |
| Transform | hierarchyRoot |
Returns
| Type | Description |
|---|---|
| int | The number of targets actually registered. |
RegisterTransformTargets(ProceduralAnimatorProfileSO, Transform)
Registers every valid transform target the profile declares, resolving each transform relative to
hierarchyRoot.
Declaration
public int RegisterTransformTargets(ProceduralAnimatorProfileSO profile, Transform hierarchyRoot)
Parameters
| Type | Name | Description |
|---|---|---|
| ProceduralAnimatorProfileSO | profile | |
| Transform | hierarchyRoot |
Returns
| Type | Description |
|---|---|
| int | The number of targets actually registered. |
Remarks
Profile-driven targets (character rigs, world objects) never opt into position animation here — that
gate exists for HUD's layout-hostility problem specifically (see TransformDelta's own remarks);
a profile target that genuinely needs it can still register at runtime through
ProceduralAnimatorComponent.RegisterTransformTarget with an explicit true.