This commit is contained in:
CroakFang
2022-09-29 17:44:06 +08:00
parent 52e61aa7b9
commit f2555a32fc
+9 -9
View File
@@ -901,7 +901,15 @@ public class UmaViewerBuilder : MonoBehaviour
private void LoadAnimation(AnimationClip clip)
{
bool needTransit = false;
if (clip.name.EndsWith("_loop"))
if (clip.name.EndsWith("_S"))
{
CurrentUMAContainer.OverrideController["clip_s"] = clip;
}
else if (clip.name.EndsWith("_E"))
{
CurrentUMAContainer.OverrideController["clip_e"] = clip;
}
else if (clip.name.EndsWith("_loop"))
{
var motion_s = Main.AbList.FirstOrDefault(a => a.Name.EndsWith(clip.name.Replace("_loop", "_s")));
var motion_e = Main.AbList.FirstOrDefault(a => a.Name.EndsWith(CurrentUMAContainer.OverrideController["clip_2"].name.Replace("_loop", "_e")));
@@ -919,14 +927,6 @@ public class UmaViewerBuilder : MonoBehaviour
CurrentUMAContainer.UmaAnimator.Play("motion_1", -1);
CurrentUMAContainer.UmaAnimator.SetTrigger(needTransit ? "next_s" : "next");
}
else if(clip.name.EndsWith("_S"))
{
CurrentUMAContainer.OverrideController["clip_s"] = clip;
}
else if(clip.name.EndsWith("_E"))
{
CurrentUMAContainer.OverrideController["clip_e"] = clip;
}
else
{
CurrentUMAContainer.OverrideController["clip_1"] = CurrentUMAContainer.OverrideController["clip_2"];