Fix calling Or() after TransitionsFromEntry().When(...) no longer fails:

- Calling Or() after TransitionsFromEntry().When(...) used to fail due to an unexpected internal state.
- This was due to the implicit conversion operator, which converted a null AnimationState to a AacTransitionEndpoint containing null in it.
- Fix this by returning null in the implicit conversion operators.
This commit is contained in:
Haï~
2024-08-19 03:22:35 +02:00
parent cca33c83da
commit 5df8f375ad
@@ -1038,11 +1038,17 @@ namespace AnimatorAsCode.V1
public static implicit operator AacTransitionEndpoint(AnimatorState state)
{
// We don't want a null AnimatorState to become an AacTransitionEndpoint that contains null in it
if (state == null) return null;
return new AacTransitionEndpoint(state);
}
public static implicit operator AacTransitionEndpoint(AnimatorStateMachine stateMachine)
{
// We don't want a null AnimatorStateMachine to become an AacTransitionEndpoint that contains null in it
if (stateMachine == null) return null;
return new AacTransitionEndpoint(stateMachine);
}