DrawLookAtGizmo

This commit is contained in:
ousttrue
2021-06-16 15:38:10 +09:00
parent 8a01eae5f1
commit 2664a773e0
3 changed files with 18 additions and 20 deletions

View File

@@ -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);

View File

@@ -28,6 +28,9 @@ namespace UniVRM10
[SerializeField]
public Transform SpringBoneCenter;
[SerializeField, Header("LookAt")]
public bool DrawLookAtGizmo = true;
/// <summay>
/// LookAtTargetTypes.CalcYawPitchToGaze時の注視点
/// </summary>

View File

@@ -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)
{