mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-12 13:59:21 -05:00
DrawLookAtGizmo
This commit is contained in:
@@ -16,6 +16,10 @@ namespace UniVRM10
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!target.DrawLookAtGizmo)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (head == null)
|
||||
{
|
||||
return;
|
||||
@@ -36,11 +40,6 @@ namespace UniVRM10
|
||||
|
||||
static void OnSceneGUIOffset(VRM10Controller m_target, Transform head)
|
||||
{
|
||||
if (!m_target.Vrm.LookAt.DrawGizmo)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
|
||||
var worldOffset = head.localToWorldMatrix.MultiplyPoint(m_target.Vrm.LookAt.OffsetFromHead);
|
||||
|
||||
@@ -28,6 +28,9 @@ namespace UniVRM10
|
||||
[SerializeField]
|
||||
public Transform SpringBoneCenter;
|
||||
|
||||
[SerializeField, Header("LookAt")]
|
||||
public bool DrawLookAtGizmo = true;
|
||||
|
||||
/// <summay>
|
||||
/// LookAtTargetTypes.CalcYawPitchToGaze時の注視点
|
||||
/// </summary>
|
||||
|
||||
@@ -16,9 +16,6 @@ namespace UniVRM10
|
||||
SetYawPitch,
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
public bool DrawGizmo = true;
|
||||
|
||||
[SerializeField]
|
||||
public Vector3 OffsetFromHead = new Vector3(0, 0.06f, 0);
|
||||
|
||||
@@ -164,17 +161,17 @@ namespace UniVRM10
|
||||
|
||||
const float LOOKAT_GIZMO_SIZE = 0.5f;
|
||||
|
||||
private void OnDrawGizmos()
|
||||
{
|
||||
if (DrawGizmo)
|
||||
{
|
||||
if (m_leftEye != null & m_rightEye != null)
|
||||
{
|
||||
DrawMatrix(m_leftEye.localToWorldMatrix, LOOKAT_GIZMO_SIZE);
|
||||
DrawMatrix(m_rightEye.localToWorldMatrix, LOOKAT_GIZMO_SIZE);
|
||||
}
|
||||
}
|
||||
}
|
||||
// private void OnDrawGizmos()
|
||||
// {
|
||||
// if (DrawGizmo)
|
||||
// {
|
||||
// if (m_leftEye != null & m_rightEye != null)
|
||||
// {
|
||||
// DrawMatrix(m_leftEye.localToWorldMatrix, LOOKAT_GIZMO_SIZE);
|
||||
// DrawMatrix(m_rightEye.localToWorldMatrix, LOOKAT_GIZMO_SIZE);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
#endregion
|
||||
|
||||
const float RADIUS = 0.5f;
|
||||
@@ -182,7 +179,6 @@ namespace UniVRM10
|
||||
public void OnSceneGUILookAt(Transform head, LookAtTargetTypes lookAtTargetType, Transform gaze)
|
||||
{
|
||||
if (head == null) return;
|
||||
if (!DrawGizmo) return;
|
||||
|
||||
if (gaze != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user