void DrawBounds() { GUIKit.RecordAndSetHandlesMatrix(transform.localToWorldMatrix); GUIKit.RecordAndSetHandlesColor(boundsColor); GUIKit.HandlesDrawWireLocalBounds(mesh.bounds); GUIKit.RestoreHandlesColor(); GUIKit.RestoreHandlesMatrix(); }
void OnSceneGUI() { var rigidbody = target as Rigidbody; Vector3 center = rigidbody.worldCenterOfMass; Vector3 normal = SceneView.currentDrawingSceneView.rotation * Vector3.back; float handleSize = HandleUtility.GetHandleSize(center); GUIKit.RecordAndSetHandlesColor(bigDiscColor); Handles.DrawSolidDisc(center, normal, bigDiscSize * handleSize); GUIKit.RestoreHandlesColor(); GUIKit.RecordAndSetHandlesColor(smallDiscColor); Handles.DrawSolidDisc(center, normal, smallDiscSize * handleSize); GUIKit.RestoreHandlesColor(); }
void DrawNormals() { GUIKit.RecordAndSetHandlesMatrix(transform.localToWorldMatrix); var normals = mesh.normals; if (!Kit.IsNullOrEmpty(normals)) { int count = normals.Length; var vertices = mesh.vertices; GUIKit.RecordAndSetHandlesColor(normalsColor); for (int i = 0; i < count; i++) { GUIKit.HandlesDrawAALine(vertices[i], vertices[i] + normals[i] * normalsSize); } GUIKit.RestoreHandlesColor(); } GUIKit.RestoreHandlesMatrix(); }