Revert "fix: remove unnecessory exit transitions for reactive components (#1161)" (#1248)

This reverts commit 9dfa0dae23. Those
transitions are needed when controlling the same object from multiple
parameters.

Closes: #1233
This commit is contained in:
bd_ 2024-10-02 19:03:44 -07:00 committed by GitHub
parent 36e035c8c7
commit 02204c272f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -300,8 +300,7 @@ namespace nadena.dev.modular_avatar.core.editor
var transitionBuffer = new List<(AnimatorState, List<AnimatorStateTransition>)>();
var entryTransitions = new List<AnimatorTransition>();
var initialStateTransitionList = new List<AnimatorStateTransition>();
transitionBuffer.Add((initialState, initialStateTransitionList));
transitionBuffer.Add((initialState, new List<AnimatorStateTransition>()));
foreach (var group in info.actionGroups.Skip(lastConstant))
{
@ -321,6 +320,8 @@ namespace nadena.dev.modular_avatar.core.editor
var conditions = GetTransitionConditions(asc, group);
foreach (var (st, transitions) in transitionBuffer)
{
if (!group.Inverted)
{
var transition = new AnimatorStateTransition
@ -331,13 +332,13 @@ namespace nadena.dev.modular_avatar.core.editor
hasFixedDuration = true,
conditions = (AnimatorCondition[])conditions.Clone()
};
initialStateTransitionList.Add(transition);
transitions.Add(transition);
}
else
{
foreach (var cond in conditions)
{
initialStateTransitionList.Add(new AnimatorStateTransition
transitions.Add(new AnimatorStateTransition
{
isExit = true,
hasExitTime = false,
@ -347,6 +348,7 @@ namespace nadena.dev.modular_avatar.core.editor
});
}
}
}
var state = new AnimatorState();