mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-14 06:19:47 -05:00
aim gizmo
This commit is contained in:
parent
cc304f3b90
commit
29df3f89da
|
|
@ -76,5 +76,31 @@ namespace UniVRM10
|
|||
Weight
|
||||
);
|
||||
}
|
||||
|
||||
public void OnDrawGizmosSelected()
|
||||
{
|
||||
if (Source == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Gizmos.color = Color.magenta;
|
||||
Gizmos.DrawLine(transform.position, Source.position);
|
||||
Gizmos.DrawSphere(Source.position, 0.01f);
|
||||
|
||||
Gizmos.matrix = transform.localToWorldMatrix;
|
||||
var len = 0.1f;
|
||||
switch (AimAxis)
|
||||
{
|
||||
case AimAxis.PositiveX:
|
||||
Gizmos.color = Color.red;
|
||||
Gizmos.DrawLine(Vector3.zero, Vector3.right * len);
|
||||
break;
|
||||
case AimAxis.NegativeX:
|
||||
Gizmos.color = Color.red;
|
||||
Gizmos.DrawLine(Vector3.zero, Vector3.left * len);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user