holopy3/Assets/UniGLTF/UniHumanoid/Scripts/BoneGizmoDrawer.cs
Lena Biresch 490ef558ef CleanUp
2021-01-28 13:07:52 +01:00

28 lines
672 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
}
}
}