mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-15 07:00:10 -05:00
Co-authored-by: ousttrue <oustrrue@gmail.com> Co-authored-by: ousttrue <ousttrrue@gmail.com> Co-authored-by: ousttrue <ousttrue@gmail.com> Co-authored-by: yutopp <yutopp@gmail.com>
29 lines
700 B
C#
29 lines
700 B
C#
using UnityEngine;
|
|
|
|
|
|
namespace UniHumanoid
|
|
{
|
|
public class BoneGizmoDrawer : MonoBehaviour
|
|
{
|
|
const float size = 0.03f;
|
|
readonly Vector3 SIZE = new Vector3(size, size, size);
|
|
|
|
[SerializeField]
|
|
public bool Draw = true;
|
|
|
|
void OnDrawGizmos()
|
|
{
|
|
#if UNITY_EDITOR
|
|
if (Draw && transform.parent != null)
|
|
{
|
|
Gizmos.color = Color.yellow;
|
|
Gizmos.DrawCube(transform.position, SIZE);
|
|
Gizmos.DrawLine(transform.parent.position, transform.position);
|
|
|
|
UnityEditor.Handles.Label(transform.position, name);
|
|
}
|
|
#endif
|
|
}
|
|
}
|
|
}
|