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:
@@ -1038,11 +1038,17 @@ namespace AnimatorAsCode.V1
|
|||||||
|
|
||||||
public static implicit operator AacTransitionEndpoint(AnimatorState state)
|
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);
|
return new AacTransitionEndpoint(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static implicit operator AacTransitionEndpoint(AnimatorStateMachine stateMachine)
|
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);
|
return new AacTransitionEndpoint(stateMachine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user