Skip to content

Commit

Permalink
Fix calling Or() after TransitionsFromEntry().When(...) no longer fails:
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
hai-vr committed Aug 19, 2024
1 parent cca33c8 commit 5df8f37
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1038,11 +1038,17 @@ private AacTransitionEndpoint(AnimatorStateMachine stateMachine)

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);
}

Expand Down

0 comments on commit 5df8f37

Please sign in to comment.