public override void RenderOverlay(RenderManager.CameraInfo cameraInfo) { base.RenderOverlay(cameraInfo); if (SelectedSegmentID != 0 && SelectedNodeID != 0) { HighlightSegmentEnd(cameraInfo, SelectedSegmentID, SelectedNodeID, Color.white); } else if (SelectedNodeID != 0) { RenderUtil.DrawNodeCircle(cameraInfo, Color.white, SelectedNodeID, true); } else if (SelectedSegmentID != 0) { RenderUtil.RenderSegmnetOverlay(cameraInfo, SelectedSegmentID, Color.white, true); } if (flagsPanel_ && flagsPanel_.HighlighLaneID != 0) { var laneData = new LaneData(flagsPanel_.HighlighLaneID); RenderUtil.RenderLaneOverlay(cameraInfo, laneData, Color.yellow, false); } if (!HoverValid) { return; } Color color; if (Input.GetMouseButton(0)) { color = GetToolColor(true, false); } else if (HoverHasFlags()) { color = GetToolColor(false, false); } else { color = GetToolColor(false, true); } if (SegmentMode) { RenderUtil.RenderSegmnetOverlay(cameraInfo, HoveredSegmentID, color, true); } else if (NodeMode) { RenderUtil.DrawNodeCircle(cameraInfo, color, HoveredNodeID, true); } else if (SegmentEndMode) { HighlightSegmentEnd(cameraInfo, HoveredSegmentID, HoveredNodeID, color); } }
public override void Render(RenderManager.CameraInfo cameraInfo) { Log.Debug("LaneEditor.Render()"); if (IsHoverItem) { if (IsSelectItem) { if (SelectItem?.Object.LaneID != HoverItem.Object.LaneID) { RenderUtil.RenderLaneOverlay(cameraInfo, HoverItem.Object, Color.yellow, true); } } else { RenderUtil.RenderLaneOverlay(cameraInfo, HoverItem.Object, Color.yellow, true); } } }
public override void RenderOverlay(RenderManager.CameraInfo cameraInfo) { RenderUtil.RenderLaneOverlay(cameraInfo, Tool.SegmentInstance.Lanes[HoveredLaneIndex], Color.white, true); }
internal static void RenderOverlay(RenderManager.CameraInfo cameraInfo) { //Log.DebugWait($"Managers_RenderOverlay.Postfix(): LaneIndex={LaneIndex} Info={Info}"); if (HoveredInfo is NetInfo.Lane laneInfo) { for (ushort segmentID = 1; segmentID < NetManager.MAX_SEGMENT_COUNT; ++segmentID) { if (!NetUtil.IsSegmentValid(segmentID)) { continue; } var m_lanes = segmentID.ToSegment().Info.m_lanes; int laneIndex = m_lanes.IndexOf(laneInfo); if (laneIndex < 0) { continue; } uint laneID = NetUtil.GetlaneID(segmentID, laneIndex); LaneData lane = new LaneData(laneID, laneIndex); RenderUtil.RenderLaneOverlay(cameraInfo, lane, Color.yellow); } } while (SegmentQueue.Count > 0) { var item = SegmentQueue.Dequeue(); Color color = item.TurnAround ? ORANGE : Color.yellow; RenderUtil.RenderSegmnetOverlay(cameraInfo, item.SegmentID, color); } while (NodeQueue.Count > 0) { var item = NodeQueue.Dequeue(); bool end = item.NodeID.ToNode().m_flags.IsFlagSet(NetNode.Flags.End); if (item.IsBendNode || end) { RenderUtil.DrawNodeCircle(cameraInfo, Color.yellow, item.NodeID); } else if (item.IsDC) { DrawDC(cameraInfo, item.SegmentID, item.SegmentID2, item.NodeID); } else { HighlightSegmentEnd(cameraInfo, item.SegmentID, item.NodeID, Color.yellow); } } while (PropQueue.Count > 0) { var item = PropQueue.Dequeue(); PropTool.RenderOverlay( cameraInfo, item.Prop, item.Pos, item.Scale, item.Angle, Color.yellow); } while (TreeQueue.Count > 0) { var item = TreeQueue.Dequeue(); TreeTool.RenderOverlay(cameraInfo, item.Tree, item.Pos, item.Scale, Color.yellow); } }