mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-08 20:08:53 -05:00
yawpitch
This commit is contained in:
@@ -57,7 +57,7 @@ namespace UniVRM10.VRM10Viewer
|
||||
}
|
||||
}
|
||||
|
||||
public Loaded(RuntimeGltfInstance instance, Transform lookAtTarget)
|
||||
public Loaded(RuntimeGltfInstance instance)
|
||||
{
|
||||
m_instance = instance;
|
||||
|
||||
@@ -70,9 +70,6 @@ namespace UniVRM10.VRM10Viewer
|
||||
m_lipSync = instance.gameObject.AddComponent<VRM10AIUEO>();
|
||||
m_blink = instance.gameObject.AddComponent<VRM10Blinker>();
|
||||
m_autoExpression = instance.gameObject.AddComponent<VRM10AutoExpression>();
|
||||
|
||||
m_controller.LookAtTargetType = VRM10ObjectLookAt.LookAtTargetTypes.SpecifiedTransform;
|
||||
m_controller.LookAtTarget = lookAtTarget;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27458,7 +27458,6 @@ MonoBehaviour:
|
||||
m_pastePose: {fileID: 1307084564}
|
||||
m_showBoxMan: {fileID: 1767706908}
|
||||
m_useAsync: {fileID: 602093299}
|
||||
m_target: {fileID: 802105000}
|
||||
m_motion: {fileID: 4900000, guid: 08df5151e71aed748b13547492fb8b9a, type: 3}
|
||||
m_useSpringboneSingelton: {fileID: 522109225}
|
||||
m_springbonePause: {fileID: 1728528389}
|
||||
@@ -27502,7 +27501,8 @@ MonoBehaviour:
|
||||
m_lipOh: {fileID: 601334856}
|
||||
m_enableAutoBlink: {fileID: 634488422}
|
||||
m_blink: {fileID: 223244499}
|
||||
m_lookAtTarget: {fileID: 619400621}
|
||||
m_lookAtTarget: {fileID: 802105000}
|
||||
m_useLookAtTarget: {fileID: 619400621}
|
||||
m_yaw: {fileID: 833614002}
|
||||
m_pitch: {fileID: 374061190}
|
||||
m_texts:
|
||||
|
||||
@@ -14,7 +14,6 @@ namespace UniVRM10.VRM10Viewer
|
||||
{
|
||||
[SerializeField]
|
||||
GameObject Root = default;
|
||||
|
||||
[SerializeField]
|
||||
Text m_version = default;
|
||||
|
||||
@@ -34,9 +33,6 @@ namespace UniVRM10.VRM10Viewer
|
||||
[SerializeField]
|
||||
Toggle m_useAsync = default;
|
||||
|
||||
[SerializeField]
|
||||
GameObject m_target = default;
|
||||
|
||||
[SerializeField]
|
||||
TextAsset m_motion;
|
||||
|
||||
@@ -106,7 +102,9 @@ namespace UniVRM10.VRM10Viewer
|
||||
Slider m_blink = default;
|
||||
|
||||
[SerializeField]
|
||||
Toggle m_lookAtTarget = default;
|
||||
GameObject m_lookAtTarget = default;
|
||||
[SerializeField]
|
||||
Toggle m_useLookAtTarget = default;
|
||||
[SerializeField]
|
||||
Slider m_yaw = default;
|
||||
[SerializeField]
|
||||
@@ -345,14 +343,14 @@ namespace UniVRM10.VRM10Viewer
|
||||
m_enableAutoBlink = map.Get<Toggle>("EnableAutoBlink");
|
||||
m_blink = map.Get<Slider>("SliderBlink");
|
||||
|
||||
m_lookAtTarget = map.Get<Toggle>("UseLookAtTarget");
|
||||
m_useLookAtTarget = map.Get<Toggle>("UseLookAtTarget");
|
||||
m_yaw = map.Get<Slider>("SliderYaw");
|
||||
m_pitch = map.Get<Slider>("SliderPitch");
|
||||
|
||||
#if UNITY_2022_3_OR_NEWER
|
||||
m_target = GameObject.FindFirstObjectByType<VRM10TargetMover>().gameObject;
|
||||
#else
|
||||
m_target = GameObject.FindObjectOfType<VRM10TargetMover>().gameObject;
|
||||
m_lookAtTarget = GameObject.FindObjectOfType<VRM10TargetMover>().gameObject;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -489,6 +487,21 @@ namespace UniVRM10.VRM10Viewer
|
||||
SupportsScalingAtRuntime = m_springboneScaling.isOn,
|
||||
});
|
||||
}
|
||||
|
||||
if (m_useLookAtTarget.isOn)
|
||||
{
|
||||
m_loaded.Instance.LookAtTargetType = VRM10ObjectLookAt.LookAtTargetTypes.SpecifiedTransform;
|
||||
m_loaded.Instance.LookAtTarget = m_lookAtTarget.transform;
|
||||
m_yaw.interactable = false;
|
||||
m_pitch.interactable = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_loaded.Instance.LookAtTargetType = VRM10ObjectLookAt.LookAtTargetTypes.YawPitchValue;
|
||||
m_loaded.Instance.Runtime.LookAt.SetYawPitchManually(m_yaw.value, m_pitch.value);
|
||||
m_yaw.interactable = true;
|
||||
m_pitch.interactable = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -647,7 +660,7 @@ namespace UniVRM10.VRM10Viewer
|
||||
var instance = vrm10Instance.GetComponent<RuntimeGltfInstance>();
|
||||
instance.ShowMeshes();
|
||||
instance.EnableUpdateWhenOffscreen();
|
||||
m_loaded = new Loaded(instance, m_target.transform);
|
||||
m_loaded = new Loaded(instance);
|
||||
m_showBoxMan.isOn = false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user