mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-04-24 06:57:49 -05:00
OnDrawGizmosSelected
This commit is contained in:
parent
83c407a42f
commit
fc5e767680
|
|
@ -19,6 +19,9 @@ namespace UniVRM10
|
|||
[Serializable]
|
||||
public class VRM10SpringBone : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
Color m_gizmoColor = Color.yellow;
|
||||
|
||||
[SerializeField]
|
||||
public string Comment;
|
||||
|
||||
|
|
@ -100,13 +103,13 @@ namespace UniVRM10
|
|||
}
|
||||
}
|
||||
|
||||
public void DrawGizmo(Color color)
|
||||
public void OnDrawGizmosSelected()
|
||||
{
|
||||
foreach (var joint in Joints)
|
||||
{
|
||||
if (joint != null)
|
||||
{
|
||||
joint.DrawGizmo(m_center, color);
|
||||
joint.DrawGizmo(m_center, m_gizmoColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@ namespace UniVRM10
|
|||
[AddComponentMenu("VRM10/VRM10SpringBoneColliderGroup")]
|
||||
public class VRM10SpringBoneColliderGroup : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
Color m_gizmoColor = Color.cyan;
|
||||
|
||||
[SerializeField]
|
||||
public List<VRM10SpringBoneCollider> Colliders = new List<VRM10SpringBoneCollider>();
|
||||
|
||||
|
|
@ -61,9 +64,9 @@ namespace UniVRM10
|
|||
}
|
||||
}
|
||||
|
||||
public void DrawGizmos(Color color)
|
||||
public void OnDrawGizmosSelected()
|
||||
{
|
||||
Gizmos.color = color;
|
||||
Gizmos.color = m_gizmoColor;
|
||||
Matrix4x4 mat = transform.localToWorldMatrix;
|
||||
Gizmos.matrix = mat * Matrix4x4.Scale(new Vector3(
|
||||
1.0f / transform.lossyScale.x,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace UniVRM10
|
||||
{
|
||||
|
|
@ -43,7 +46,11 @@ namespace UniVRM10
|
|||
}
|
||||
else
|
||||
{
|
||||
// TODO
|
||||
#if UNITY_EDITOR
|
||||
// Gizmos.matrix = Transform.localToWorldMatrix;
|
||||
Gizmos.color = color;
|
||||
Gizmos.DrawSphere(Transform.position, m_jointRadius);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user