Skip to content

Commit

Permalink
Merge pull request #5 from paralleltree/fix-gesture-state
Browse files Browse the repository at this point in the history
Gunステートが生成対象から漏れていた点を修正
  • Loading branch information
paralleltree authored Nov 9, 2024
2 parents b06be06 + b655288 commit 47d9681
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Editor/FaceEmoteProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,11 @@ AnimatorState GenerateAnimatorState(string name, AnimationClip motion)
{
GenerateAnimatorState($"Fist {i}", def.Fist),
GenerateAnimatorState($"Open {i}", def.Open),
GenerateAnimatorState( $"Point {i}", def.Point),
GenerateAnimatorState($"Point {i}", def.Point),
GenerateAnimatorState($"Peace {i}", def.Peace),
GenerateAnimatorState($"RockNRoll {i}", def.RockNRoll),
GenerateAnimatorState($"Thumbs up {i}",def.ThumbsUp),
GenerateAnimatorState($"Gun {i}", def.Gun),
GenerateAnimatorState($"Thumbs up {i}", def.ThumbsUp),
};

// ExpressionSet切り替えの遷移
Expand Down
6 changes: 6 additions & 0 deletions Tests/FaceEmoteProcessorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ void ValidateEmoteSetStateMachineSubSetRoot(AnimatorState node, int setIndex, st
Assert.AreEqual(new AnimatorCondition() { mode = AnimatorConditionMode.NotEqual, parameter = "ExpressionSet", threshold = setIndex }, childIdleToGlobalIdle.conditions[0]);


var gotGestureSet = new HashSet<int>();
foreach (var trans in node.transitions.Where(trans => trans.destinationState.name != "Idle"))
{
// Idle to expression state
Expand All @@ -213,7 +214,12 @@ void ValidateEmoteSetStateMachineSubSetRoot(AnimatorState node, int setIndex, st
Assert.AreEqual(false, trans.hasExitTime);
Assert.AreEqual(true, trans.hasFixedDuration);
ValidateEmoteSetStateMachineSubSetEmote(trans.destinationState, setIndex, (int)cond.threshold, handSide);
gotGestureSet.Add((int)cond.threshold);
}

// assert all gesture state existence
var expectedGestureSet = new int[] { 1, 2, 3, 4, 5, 6, 7 };
Assert.IsTrue(gotGestureSet.SetEquals(expectedGestureSet));
}

void ValidateEmoteSetStateMachineSubSetEmote(AnimatorState node, int setIndex, int gestureIndex, string handSide)
Expand Down

0 comments on commit 47d9681

Please sign in to comment.