(BREAKING) Add AnimatorAsCode V1:

- Breaking changes:
  - Remove dependency to VRChat in the AnimatorAsCode.V1 namespace. The namespace should now be usable in non-VRChat projects.
  - All VRChat-specific methods are now extension functions in a separate namespace, AnimatorAsCode.V1.VRC.
  - VRChat methods that modify existing assets are split into a separate namespace, AnimatorAsCode.V1.VRCDestructiveWorkflow.
- Breaking fixes:
  - Fix incorrect type signature on AacFlFloatParameterGroup.ToList() and AacFlIntParameterGroup.ToList().
- Add AacFlBase.NewBlendTree():
  - This allows creating blend trees as code.
  - Add AacFlState.WithAnimation(AacFlBlendTree).
- Add AacFlBase.NoAnimator():
  - This can be used to obtain AacFlParameter objects for use in the generation of BlendTrees and other systems, without requiring the existence of a backing animator controller.
  - This can also be used in some cases where there are type casts (Bool to Float, Float to Bool).
- Add AacFlBase.NewAnimatorController():
  - This is meant to be used for non-destructive workflows.
  - This creates an animator controller inside the asset container. This animator controller will be reaped in the same way as other assets are reaped.
This commit is contained in:
Haï~
2023-10-02 04:51:07 +02:00
parent 3f5fd7aff7
commit d22d73cc82
10 changed files with 483 additions and 169 deletions
+8 -2
View File
@@ -7,7 +7,7 @@ using UnityEngine;
// ReSharper disable once CheckNamespace
namespace AnimatorAsCode.V1
{
internal class AacBackingAnimator
public class AacBackingAnimator
{
private readonly AacAnimatorGenerator _generator;
@@ -134,7 +134,7 @@ namespace AnimatorAsCode.V1
_childNodes = new List<AacAnimatorNode>();
}
internal AacBackingAnimator BackingAnimator()
public AacBackingAnimator InternalBackingAnimator()
{
return _backingAnimator;
}
@@ -332,6 +332,12 @@ namespace AnimatorAsCode.V1
return this;
}
public AacFlState WithAnimation(AacFlBlendTree blendTree)
{
State.motion = blendTree.BlendTree;
return this;
}
public AacFlTransition TransitionsTo(AacFlState destination)
{
return new AacFlTransition(ConfigureTransition(State.AddTransition(destination.State)), _machine, State, destination.State);