Skip to content

Instantly share code, notes, and snippets.

@namutaka
Created July 28, 2012 16:59
Show Gist options
  • Save namutaka/3193999 to your computer and use it in GitHub Desktop.
Save namutaka/3193999 to your computer and use it in GitHub Desktop.
UnityでのSphereColliderのGizmo表示
function OnDrawGizmos() {
var collider : SphereCollider = GetComponent(SphereCollider);
var scale = transform.localScale;
Gizmos.color = Color.yellow;
Gizmos.DrawWireSphere(
transform.TransformPoint(collider.center),
Mathf.Max(scale.x, scale.y, scale.z) * collider.radius);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment