private void DrawVisibilityGizmos() { // Check draw toggle if (m_DrawVisibility == false) { return; } // Iterate all debug data in Visibility table foreach (VisbilityData visibilityData in m_PortalData.visibilityTable) { foreach (VisbilityData.Debug debug in visibilityData.debugData) { if (debug.isHit) { // Draw line between ray source and Occluder hit point PortalDebugUtil.DrawSphere(debug.source, 0.1f, PortalDebugColors.black); PortalDebugUtil.DrawSphere(debug.hit, 0.1f, PortalDebugColors.black); PortalDebugUtil.DrawLine(debug.source, debug.hit, PortalDebugColors.black); } else { // Draw line between ray source and Occludee (rough) PortalDebugUtil.DrawSphere(debug.source, 0.1f, PortalDebugColors.white); PortalDebugUtil.DrawRay(debug.source, debug.direction, debug.distance, PortalDebugColors.white); } } } }
private void DrawVolumeGizmos() { // Check draw toggle if (m_DrawVolumes == false) { return; } // Draw gizmos for all Volumes foreach (SerializableVolume volume in PortalPrepareUtil.FilterVolumeDataNoChildren(m_PortalData.volumes)) { PortalDebugUtil.DrawCube(volume.positionWS, volume.rotationWS, volume.scaleWS, PortalDebugColors.volume); } }
private void DrawOccluderGizmos() { // Check draw toggle if (m_DrawOccluders == false) { return; } // Draw gizmos for all Occluders foreach (SerializableOccluder occluder in m_PortalData.occluders) { PortalDebugUtil.DrawMesh(occluder.positionWS, occluder.rotationWS, occluder.scaleWS, occluder.mesh, PortalDebugColors.occluder); } }
// -------------------------------------------------- // // GIZMOS // // -------------------------------------------------- // #if UNITY_EDITOR private void OnDrawGizmos() { Gizmos.DrawIcon(transform.position, "kTools/Portals/PortalVolume icon.png", true); PortalDebugUtil.DrawCube(transform.position, transform.rotation, transform.lossyScale, PortalDebugColors.volume); }