Skip to content

Commit

Permalink
Add missing Gun state
Browse files Browse the repository at this point in the history
  • Loading branch information
paralleltree committed Nov 9, 2024
1 parent b06be06 commit b655288
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 b655288

Please sign in to comment.