Add AacFlState.PlayableEnables(...), PlayableDisables, and PlayableSets:

- Add AacFlState.PlayableEnables(...) with 0-duration default overload.
  This function is exposed with the assumption that Playable Layer Control would often be used with a all-or-nothing weight.
- Add AacFlState.PlayableDisables(...) with 0-duration default overload.
- Add AacFlState.PlayableSets(...) to control everything about the behaviour.
This commit is contained in:
Haï~
2022-05-10 20:02:55 +02:00
parent 48855de6ce
commit 4d6aa08314
2 changed files with 25 additions and 0 deletions
+20
View File
@@ -508,6 +508,26 @@ namespace AnimatorAsCode.V0
return this;
}
public AacFlState PlayableEnables(VRC_PlayableLayerControl.BlendableLayer blendable, float blendDurationSeconds = 0f)
{
return PlayableSets(blendable, blendDurationSeconds, 1.0f);
}
public AacFlState PlayableDisables(VRC_PlayableLayerControl.BlendableLayer blendable, float blendDurationSeconds = 0f)
{
return PlayableSets(blendable, blendDurationSeconds, 0.0f);
}
public AacFlState PlayableSets(VRC_PlayableLayerControl.BlendableLayer blendable, float blendDurationSeconds, float weight)
{
var playable = State.AddStateMachineBehaviour<VRCPlayableLayerControl>();
playable.layer = blendable;
playable.goalWeight = weight;
playable.blendDuration = blendDurationSeconds;
return this;
}
public AacFlState MotionTime(AacFlFloatParameter floatParam)
{
State.timeParameterActive = true;