Add AacFlState.WithCycleOffset(...), WithCycleOffsetSetTo, and WithSpeedSetTo:

- Add AacFlState.WithCycleOffset(...)
- Add AacFlState.WithCycleOffsetSetTo(...) which takes a fixed value.
- Add AacFlState.WithSpeedSetTo(...) which takes a fixed value. AacFlState.WithSpeed(...) already exists.
This commit is contained in:
Haï~
2022-05-10 20:02:55 +02:00
parent f846228d82
commit 508b458fba
2 changed files with 28 additions and 1 deletions
+25 -1
View File
@@ -536,6 +536,22 @@ namespace AnimatorAsCode.V0
return this;
}
public AacFlState WithCycleOffset(AacFlFloatParameter floatParam)
{
State.cycleOffsetParameterActive = false;
State.cycleOffsetParameter = floatParam.Name;
return this;
}
public AacFlState WithCycleOffsetSetTo(float cycleOffset)
{
State.cycleOffsetParameterActive = false;
State.cycleOffset = cycleOffset;
return this;
}
private void SettingElementTo(TrackingElement element, VRC_AnimatorTrackingControl.TrackingType target)
{
switch (element)
@@ -604,8 +620,16 @@ namespace AnimatorAsCode.V0
public AacFlState WithSpeed(AacFlFloatParameter parameter)
{
State.speedParameter = parameter.Name;
State.speedParameterActive = true;
State.speedParameter = parameter.Name;
return this;
}
public AacFlState WithSpeedSetTo(float speed)
{
State.speedParameterActive = false;
State.speed = speed;
return this;
}
+3
View File
@@ -668,7 +668,10 @@ foreach (var cancelWhenNotAllowed in new[] {auto, reverse, manual, custom, done}
- `AacFlState WithAnimation(AacFlClip clip)` /// Set a specific clip for the state. See `(AacFlBase).NewClip()` and similar.
- `AacFlState MotionTime(AacFlFloatParameter floatParam)` /// Set the Motion Time, formerly known as Normalized Time.
- `AacFlState WithSpeed(AacFlFloatParameter parameter)` /// Set the Speed.
- `AacFlState WithSpeedSetTo(float speed)` /// Set the Speed to a specific value.
- `AacFlState WithWriteDefaultsSetTo(bool shouldWriteDefaults)` /// Set Write Defaults. If you need to do this to many states, consider changing the AacConfiguration DefaultsProvider when creating Animator As Code.
- `AacFlState WithCycleOffset(AacFlFloatParameter floatParam)` /// Set the Cycle Offset.
- `AacFlState WithCycleOffsetSetTo(float cycleOffset)` /// Set the Cycle Offset to a specific value.
## Transitions