Class BoneNoiseDriver
- Namespace
- CodeSmile.AnyMotion.AnimateYourself.Shake /
- Assembly
- ApiSource.dll
L37 (shake & noise generator): per-bone rotational tremor, jitter and noise, applied additively
on top of whatever pose the rig already has this frame. See shake-noise-spec.md for the
design decisions behind this class.
[DefaultExecutionOrder(1001)]
public sealed class BoneNoiseDriver : MonoBehaviour
Expand Details ...
- Inheritance
-
objectObjectComponentBehaviourMonoBehaviourBoneNoiseDriver
Remarks
Runs after GaitDriver (execution order 1000) so its output adds to the gait pose instead of
replacing it. It resolves its own bone Transforms and never resets a bone to a reference pose, so
it has no RigMetrics or BindPose dependency and can drive a rig with no WalkGait present at all —
required for reuse outside AnimateYourself (shake-noise-spec.md §2).
HumanoidBoneSet.RotateAboutRootAxes cannot be reused here: it always writes
rotation * bindWorld, discarding whatever is already on the bone. This class composes
its delta onto the current rotation instead — see ApplyChannel(BoneChannel, float).
Properties
ApplyInEditMode
public bool ApplyInEditMode { get; }
Property Value
- bool
CurrentTrauma
Current trauma value, 0..1. Read for the inspector readout.
public float CurrentTrauma { get; }
Property Value
- float
ElapsedTime
Total time consumed by ApplyNow(float), scaled by TimeScale.
public float ElapsedTime { get; }
Property Value
- float
IsReady
True once an Animator has been found and its bones resolved.
public bool IsReady { get; }
Property Value
- bool
Parameters
The authored channel list. Safe to mutate at runtime.
public ShakeNoiseParameters Parameters { get; }
Property Value
TimeScale
public float TimeScale { get; set; }
Property Value
- float
TraumaDecayPerSecond
public float TraumaDecayPerSecond { get; set; }
Property Value
- float
Methods
AddTrauma(float)
Adds to the running trauma value, clamped to 1. A channel using the Trauma envelope reacts on the next ApplyNow(float) call.
public void AddTrauma(float amount)
Parameters
| Type | Name | Description |
|---|---|---|
amount |
ApplyNow(float)
Advances the noise clock and trauma decay by deltaTime seconds and writes
every channel. Called from LateUpdate at runtime, and from the editor preview outside Play mode.
public void ApplyNow(float deltaTime)
Parameters
| Type | Name | Description |
|---|---|---|
deltaTime |
ApplyParameters(ShakeNoiseParameters)
Replaces the whole channel list, for example after loading a saved preset.
public void ApplyParameters(ShakeNoiseParameters parameters)
Parameters
| Type | Name | Description |
|---|---|---|
parameters |