bug fix
This commit is contained in:
@@ -40,8 +40,6 @@ public class UmaContainer : MonoBehaviour
|
|||||||
public void MergeModel()
|
public void MergeModel()
|
||||||
{
|
{
|
||||||
if (!Body) return;
|
if (!Body) return;
|
||||||
|
|
||||||
HeadBone = (GameObject)Body.GetComponent<AssetHolder>()._assetTable.list.FindLast(a => a.Key == "head").Value;
|
|
||||||
EyeHeight = 0.1f;
|
EyeHeight = 0.1f;
|
||||||
TrackTarget = Camera.main.gameObject;
|
TrackTarget = Camera.main.gameObject;
|
||||||
|
|
||||||
@@ -137,7 +135,7 @@ public class UmaContainer : MonoBehaviour
|
|||||||
|
|
||||||
private void FixedUpdate()
|
private void FixedUpdate()
|
||||||
{
|
{
|
||||||
if (TrackTarget&&!isAnimatorControl)
|
if (TrackTarget&&!isAnimatorControl&&!IsMini)
|
||||||
{
|
{
|
||||||
var targetPosotion = TrackTarget.transform.position - HeadBone.transform.up*EyeHeight;
|
var targetPosotion = TrackTarget.transform.position - HeadBone.transform.up*EyeHeight;
|
||||||
var deltaPos = HeadBone.transform.InverseTransformPoint(targetPosotion);
|
var deltaPos = HeadBone.transform.InverseTransformPoint(targetPosotion);
|
||||||
@@ -146,7 +144,7 @@ public class UmaContainer : MonoBehaviour
|
|||||||
FaceDrivenKeyTarget.SetEyeRange(finalRotation.x, finalRotation.y, finalRotation.x, -finalRotation.y);
|
FaceDrivenKeyTarget.SetEyeRange(finalRotation.x, finalRotation.y, finalRotation.x, -finalRotation.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAnimatorControl)
|
if (isAnimatorControl && !IsMini)
|
||||||
{
|
{
|
||||||
FaceDrivenKeyTarget.ProcessLocator();
|
FaceDrivenKeyTarget.ProcessLocator();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -286,8 +286,11 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
emotionDriven.FaceDrivenKeyTarget = FaceDriven;
|
emotionDriven.FaceDrivenKeyTarget = FaceDriven;
|
||||||
emotionDriven.FaceEmotionKey = UmaDatabaseController.Instance.FaceTypeData.ToList();
|
emotionDriven.FaceEmotionKey = UmaDatabaseController.Instance.FaceTypeData.ToList();
|
||||||
emotionDriven.Initialize();
|
emotionDriven.Initialize();
|
||||||
|
|
||||||
|
CurrentUMAContainer.HeadBone = (GameObject)CurrentUMAContainer.Body.GetComponent<AssetHolder>()._assetTable.list.FindLast(a => a.Key == "head").Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CurrentUMAContainer.MergeModel();
|
CurrentUMAContainer.MergeModel();
|
||||||
CurrentUMAContainer.LoadPhysics();
|
CurrentUMAContainer.LoadPhysics();
|
||||||
LoadAsset(UmaViewerMain.Instance.AbMotions.FirstOrDefault(a => a.Name.EndsWith($"anm_eve_chr{id}_00_idle01_loop")));
|
LoadAsset(UmaViewerMain.Instance.AbMotions.FirstOrDefault(a => a.Name.EndsWith($"anm_eve_chr{id}_00_idle01_loop")));
|
||||||
@@ -956,8 +959,12 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
}
|
}
|
||||||
else if (clip.name.Contains("face"))
|
else if (clip.name.Contains("face"))
|
||||||
{
|
{
|
||||||
CurrentUMAContainer.FaceOverrideController["clip_1"] = clip;
|
if (CurrentUMAContainer.FaceDrivenKeyTarget)
|
||||||
CurrentUMAContainer.FaceDrivenKeyTarget.ResetLocator();
|
{
|
||||||
|
CurrentUMAContainer.FaceDrivenKeyTarget.ResetLocator();
|
||||||
|
CurrentUMAContainer.FaceOverrideController["clip_1"] = clip;
|
||||||
|
}
|
||||||
|
|
||||||
CurrentUMAContainer.isAnimatorControl = true;
|
CurrentUMAContainer.isAnimatorControl = true;
|
||||||
CurrentUMAContainer.UmaFaceAnimator.Play("motion_1", 0, 0);
|
CurrentUMAContainer.UmaFaceAnimator.Play("motion_1", 0, 0);
|
||||||
}
|
}
|
||||||
@@ -996,7 +1003,8 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
CurrentUMAContainer.isAnimatorControl = false;
|
CurrentUMAContainer.isAnimatorControl = false;
|
||||||
CurrentUMAContainer.FaceDrivenKeyTarget.ResetLocator();
|
if (CurrentUMAContainer.FaceDrivenKeyTarget)
|
||||||
|
CurrentUMAContainer.FaceDrivenKeyTarget.ResetLocator();
|
||||||
PreviewCamera.enabled = false;
|
PreviewCamera.enabled = false;
|
||||||
|
|
||||||
if (CurrentCameraAnimator)
|
if (CurrentCameraAnimator)
|
||||||
@@ -1095,8 +1103,11 @@ public class UmaViewerBuilder : MonoBehaviour
|
|||||||
if (container.Slider != null)
|
if (container.Slider != null)
|
||||||
container.Slider.SetValueWithoutNotify(0);
|
container.Slider.SetValueWithoutNotify(0);
|
||||||
}
|
}
|
||||||
CurrentUMAContainer.FaceDrivenKeyTarget.ClearMorph();
|
if (CurrentUMAContainer.FaceDrivenKeyTarget)
|
||||||
CurrentUMAContainer.FaceDrivenKeyTarget.ChangeMorph();
|
{
|
||||||
|
CurrentUMAContainer.FaceDrivenKeyTarget.ClearMorph();
|
||||||
|
CurrentUMAContainer.FaceDrivenKeyTarget.ChangeMorph();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -565,6 +565,7 @@ public class UmaViewerUI : MonoBehaviour
|
|||||||
AnimationSlider.SetValueWithoutNotify(0);
|
AnimationSlider.SetValueWithoutNotify(0);
|
||||||
// Reset settings by Panel
|
// Reset settings by Panel
|
||||||
Builder.CurrentUMAContainer.UmaAnimator.speed = AnimationSpeedSlider.value;
|
Builder.CurrentUMAContainer.UmaAnimator.speed = AnimationSpeedSlider.value;
|
||||||
|
if(Builder.CurrentUMAContainer.UmaFaceAnimator)
|
||||||
Builder.CurrentUMAContainer.UmaFaceAnimator.speed = AnimationSpeedSlider.value;
|
Builder.CurrentUMAContainer.UmaFaceAnimator.speed = AnimationSpeedSlider.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -668,23 +669,28 @@ public class UmaViewerUI : MonoBehaviour
|
|||||||
if (state)
|
if (state)
|
||||||
{
|
{
|
||||||
animator.speed = 0;
|
animator.speed = 0;
|
||||||
animator_face.speed = 0;
|
if (animator_face)
|
||||||
|
animator_face.speed = 0;
|
||||||
animator_cam.speed = 0;
|
animator_cam.speed = 0;
|
||||||
}
|
}
|
||||||
else if (AnimeState.normalizedTime < 1f)
|
else if (AnimeState.normalizedTime < 1f)
|
||||||
{
|
{
|
||||||
animator.speed = AnimationSpeedSlider.value;
|
animator.speed = AnimationSpeedSlider.value;
|
||||||
animator_face.speed = AnimationSpeedSlider.value;
|
|
||||||
animator_cam.speed = AnimationSpeedSlider.value;
|
animator_cam.speed = AnimationSpeedSlider.value;
|
||||||
|
if (animator_face)
|
||||||
|
animator_face.speed = AnimationSpeedSlider.value;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
animator.speed = AnimationSpeedSlider.value;
|
animator.speed = AnimationSpeedSlider.value;
|
||||||
animator.Play(0, -1, 0);
|
animator.Play(0, -1, 0);
|
||||||
animator_face.speed = AnimationSpeedSlider.value;
|
|
||||||
animator_face.Play(0, -1, 0);
|
|
||||||
animator_cam.speed = AnimationSpeedSlider.value;
|
animator_cam.speed = AnimationSpeedSlider.value;
|
||||||
animator_cam.Play(0, -1, 0);
|
animator_cam.Play(0, -1, 0);
|
||||||
|
if (animator_face)
|
||||||
|
{
|
||||||
|
animator_face.speed = AnimationSpeedSlider.value;
|
||||||
|
animator_face.Play(0, -1, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -703,10 +709,13 @@ public class UmaViewerUI : MonoBehaviour
|
|||||||
// Pause and Seek;
|
// Pause and Seek;
|
||||||
animator.speed = 0;
|
animator.speed = 0;
|
||||||
animator.Play(0, -1, val);
|
animator.Play(0, -1, val);
|
||||||
animator_face.speed = 0;
|
|
||||||
animator_face.Play(0, -1, val);
|
|
||||||
animator_cam.speed = 0;
|
animator_cam.speed = 0;
|
||||||
animator_cam.Play(0, -1, val);
|
animator_cam.Play(0, -1, val);
|
||||||
|
if (animator_face)
|
||||||
|
{
|
||||||
|
animator_face.speed = 0;
|
||||||
|
animator_face.Play(0, -1, val);
|
||||||
|
}
|
||||||
|
|
||||||
AnimationProgressText.text = string.Format("{0} / {1}", ToFrameFormat(val * AnimeClip.length, AnimeClip.frameRate), ToFrameFormat(AnimeClip.length, AnimeClip.frameRate));
|
AnimationProgressText.text = string.Format("{0} / {1}", ToFrameFormat(val * AnimeClip.length, AnimeClip.frameRate), ToFrameFormat(AnimeClip.length, AnimeClip.frameRate));
|
||||||
}
|
}
|
||||||
@@ -717,8 +726,11 @@ public class UmaViewerUI : MonoBehaviour
|
|||||||
AnimationSpeedText.text = string.Format("Animation Speed: {0:F2}", val);
|
AnimationSpeedText.text = string.Format("Animation Speed: {0:F2}", val);
|
||||||
if (!Builder.CurrentUMAContainer || !Builder.CurrentUMAContainer.UmaAnimator) return;
|
if (!Builder.CurrentUMAContainer || !Builder.CurrentUMAContainer.UmaAnimator) return;
|
||||||
Builder.CurrentUMAContainer.UmaAnimator.speed = val;
|
Builder.CurrentUMAContainer.UmaAnimator.speed = val;
|
||||||
Builder.CurrentUMAContainer.UmaFaceAnimator.speed = val;
|
|
||||||
Builder.CurrentCameraAnimator.speed = val;
|
Builder.CurrentCameraAnimator.speed = val;
|
||||||
|
if (Builder.CurrentUMAContainer.UmaFaceAnimator)
|
||||||
|
{
|
||||||
|
Builder.CurrentUMAContainer.UmaFaceAnimator.speed = val;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResetAudioPlayer()
|
public void ResetAudioPlayer()
|
||||||
|
|||||||
Reference in New Issue
Block a user