From b6552883ce3cccd02cc98e31ea11dde1f28230b8 Mon Sep 17 00:00:00 2001 From: Paralleltree Date: Sat, 9 Nov 2024 22:01:38 +0900 Subject: [PATCH] Add missing Gun state --- Editor/FaceEmoteProcessor.cs | 5 +++-- Tests/FaceEmoteProcessorTest.cs | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Editor/FaceEmoteProcessor.cs b/Editor/FaceEmoteProcessor.cs index 5a1777d..b5a4107 100644 --- a/Editor/FaceEmoteProcessor.cs +++ b/Editor/FaceEmoteProcessor.cs @@ -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切り替えの遷移 diff --git a/Tests/FaceEmoteProcessorTest.cs b/Tests/FaceEmoteProcessorTest.cs index 5d616c7..f1c9ac0 100644 --- a/Tests/FaceEmoteProcessorTest.cs +++ b/Tests/FaceEmoteProcessorTest.cs @@ -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(); foreach (var trans in node.transitions.Where(trans => trans.destinationState.name != "Idle")) { // Idle to expression state @@ -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)