mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-04-24 23:18:04 -05:00
restore spring gizmo
This commit is contained in:
parent
1a28a18e29
commit
a61c3f92df
|
|
@ -15,21 +15,14 @@ namespace UniVRM10
|
|||
[SerializeField]
|
||||
public string m_comment;
|
||||
|
||||
[SerializeField, Header("Gizmo")]
|
||||
bool m_drawGizmo = default;
|
||||
|
||||
[SerializeField]
|
||||
Color m_gizmoColor = Color.yellow;
|
||||
|
||||
[SerializeField]
|
||||
public Transform m_center;
|
||||
|
||||
[SerializeField]
|
||||
public List<VRM10SpringJoint> Joints = new List<VRM10SpringJoint>();
|
||||
|
||||
[SerializeField]
|
||||
public List<VRM10SpringBoneColliderGroup> ColliderGroups = new List<VRM10SpringBoneColliderGroup>();
|
||||
|
||||
[SerializeField]
|
||||
public Transform m_center;
|
||||
|
||||
[ContextMenu("Reset bones")]
|
||||
public void ResetJoints()
|
||||
|
|
@ -100,16 +93,13 @@ namespace UniVRM10
|
|||
}
|
||||
}
|
||||
|
||||
private void OnDrawGizmos()
|
||||
public void DrawGizmo(Color color)
|
||||
{
|
||||
if (m_drawGizmo)
|
||||
foreach (var joint in Joints)
|
||||
{
|
||||
foreach (var joint in Joints)
|
||||
if (joint != null)
|
||||
{
|
||||
if (joint != null)
|
||||
{
|
||||
joint.DrawGizmo(m_center, m_gizmoColor);
|
||||
}
|
||||
joint.DrawGizmo(m_center, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,9 +11,17 @@ namespace UniVRM10
|
|||
[Serializable]
|
||||
public class VRM10SpringBoneManager
|
||||
{
|
||||
[SerializeField, Header("Gizmo")]
|
||||
bool m_drawGizmo = default;
|
||||
|
||||
[SerializeField]
|
||||
Color m_gizmoColor = Color.yellow;
|
||||
|
||||
|
||||
[SerializeField]
|
||||
public List<VRM10SpringBone> Springs = new List<VRM10SpringBone>();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 1フレームに一回呼び出す(VRM10Controllerの仕事)
|
||||
/// </summary>
|
||||
|
|
@ -24,5 +32,16 @@ namespace UniVRM10
|
|||
spring.Process();
|
||||
}
|
||||
}
|
||||
|
||||
public void DrawGizmos()
|
||||
{
|
||||
if (m_drawGizmo)
|
||||
{
|
||||
foreach (var spring in Springs)
|
||||
{
|
||||
spring.DrawGizmo(m_gizmoColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -168,5 +168,10 @@ namespace UniVRM10
|
|||
Apply();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDrawGizmos()
|
||||
{
|
||||
SpringBone.DrawGizmos();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user