public override bool DebugDraw() { if (!base.DebugDraw()) { return(false); } if (DRAW_DEBUG_INFORMATION) { m_debugDrawSb.Clear(); m_debugDrawSb.Append("Is working:"); m_debugDrawSb.Append(IsWorking()); m_debugDrawSb.AppendLine(); m_debugDrawSb.Append("Enabled:"); m_debugDrawSb.Append(Enabled); m_debugDrawSb.AppendLine(); m_debugDrawSb.Append("Detected entities:"); m_debugDrawSb.AppendInt32(m_sensorHandler.GetDetectedEntitiesCount()); m_debugDrawSb.AppendLine(); m_debugDrawSb.Append("Sensor interactions:"); m_debugDrawSb.AppendInt32(m_sensor.m_Interactions.Count); m_debugDrawSb.AppendLine(); KinematicPrefabStateEnum?state = null; bool?isOpened = null; bool?isClosed = null; foreach (var part in Parts) { if (part != null) { Debug.Assert(state == null || state.Value == part.GetState()); Debug.Assert(isOpened == null || isOpened.Value == part.IsOpened()); Debug.Assert(isClosed == null || isClosed.Value == part.IsClosed()); state = part.GetState(); isOpened = part.IsOpened(); isClosed = part.IsClosed(); } } if (state != null && isOpened != null && isClosed != null) { m_debugDrawSb.Append("State:"); switch (state.Value) { case KinematicPrefabStateEnum.Closing: m_debugDrawSb.Append("Closing"); break; case KinematicPrefabStateEnum.Opening: m_debugDrawSb.Append("Opening"); break; case KinematicPrefabStateEnum.Sleeping: m_debugDrawSb.Append("Sleeping"); break; } m_debugDrawSb.AppendLine(); m_debugDrawSb.Append("IsOpened:"); m_debugDrawSb.Append(isOpened.Value); m_debugDrawSb.AppendLine(); m_debugDrawSb.Append("IsClosed:"); m_debugDrawSb.Append(isClosed.Value); } MyDebugDraw.DrawText(WorldVolume.Center, m_debugDrawSb, Color.White, 0.5f); float radius = DETECTION_ANGLE != null ? DETECT_RADIUS * 0.5f : DETECT_RADIUS; MyDebugDraw.DrawSphereWireframe(WorldVolume.Center, radius, new Vector3(0f, 1f, 0f), 0.5f); if (DETECTION_ANGLE != null) { float radius2 = (float)Math.Tan(DETECTION_ANGLE.Value) * DETECT_RADIUS; Color color = Color.Red; color.A = 55; MyDebugDraw.DrawCone(WorldVolume.Center, WorldVolume.Center + WorldMatrix.Forward * DETECT_RADIUS, radius2, color); MyDebugDraw.DrawCone(WorldVolume.Center, WorldVolume.Center + WorldMatrix.Backward * DETECT_RADIUS, radius2, color); //MyDebugDraw.DrawSphereWireframe(WorldVolume.Center, DETECT_RADIUS, color.ToVector3(), 0.3f); } } return(true); }