protected override void OnCommandBufferRefresh(IRTECamera camera) { base.OnCommandBufferRefresh(camera); float hs = GetMaxHorizontalScale(true); Vector3 scale = GetHandlesScale(true); GizmoUtility.DrawCubeHandles(camera.CommandBuffer, Target.TransformPoint(Center), Target.rotation, scale, HandleProperties); GizmoUtility.DrawWireCapsule(camera.CommandBuffer, Direction, GetHeight(), Radius, Target.TransformPoint(Center), Target.rotation, new Vector3(hs, hs, hs), LineProperties); if (IsDragging) { GizmoUtility.DrawSelection(camera.CommandBuffer, HandlesTransform.MultiplyPoint(HandlesPositions[DragIndex]), Target.rotation, Target.lossyScale, SelectionProperties); } }
protected override void OnCommandBufferRefresh(IRTECamera camera) { base.OnCommandBufferRefresh(camera); Bounds bounds = Bounds; Vector3 parentScale = Target.parent == null ? Vector3.one : Target.parent.lossyScale; Vector3 scale = Vector3.Scale(Vector3.Scale(bounds.extents, Target.localScale), parentScale); GizmoUtility.DrawCubeHandles(camera.CommandBuffer, Target.TransformPoint(bounds.center), Target.rotation, scale, HandleProperties); GizmoUtility.DrawWireCube(camera.CommandBuffer, bounds, Target.TransformPoint(bounds.center), Target.rotation, Target.lossyScale, LineProperties); if (IsDragging) { GizmoUtility.DrawSelection(camera.CommandBuffer, Target.TransformPoint(bounds.center + Vector3.Scale(HandlesPositions[DragIndex], bounds.extents)), Target.rotation, Target.lossyScale, SelectionProperties); } }
protected override void OnCommandBufferRefresh(IRTECamera camera) { base.OnCommandBufferRefresh(camera); if (Target == null) { return; } Vector3 scale = Target.lossyScale * Radius; scale = Vector3.one * Mathf.Max(Mathf.Abs(scale.x), Mathf.Abs(scale.y), Mathf.Abs(scale.z)); GizmoUtility.DrawCubeHandles(camera.CommandBuffer, Target.TransformPoint(Center), Target.rotation, scale, HandleProperties); GizmoUtility.DrawWireSphere(camera.CommandBuffer, camera.Camera, Target.TransformPoint(Center), Target.rotation, scale, LineProperties); if (IsDragging) { scale = Target.lossyScale; scale = Vector3.one * Mathf.Max(Mathf.Abs(scale.x), Mathf.Abs(scale.y), Mathf.Abs(scale.z)); GizmoUtility.DrawSelection(camera.CommandBuffer, HandlesTransform.MultiplyPoint(Center + HandlesPositions[DragIndex]), Target.rotation, scale, SelectionProperties); } }