Added morph clear button

removed redundant property
This commit is contained in:
katboi01
2022-11-01 19:00:40 +01:00
parent ae640a1b4b
commit 7c07615b8a
8 changed files with 347 additions and 72 deletions
+19
View File
@@ -1043,4 +1043,23 @@ public class UmaViewerBuilder : MonoBehaviour
Destroy(CurrentUMAContainer.gameObject);
}
}
public void ClearMorphs()
{
if (CurrentUMAContainer != null && CurrentUMAContainer.FaceDrivenKeyTarget != null)
{
foreach (var container in UI.EmotionList.GetComponentsInChildren<UmaUIContainer>())
{
if (container.Slider != null)
container.Slider.value = 0;
}
foreach (var container in UI.FacialList.GetComponentsInChildren<UmaUIContainer>())
{
if (container.Slider != null)
container.Slider.SetValueWithoutNotify(0);
}
CurrentUMAContainer.FaceDrivenKeyTarget.ClearMorph();
CurrentUMAContainer.FaceDrivenKeyTarget.ChangeMorph();
}
}
}