public void AddOverlay(VisualElement ve) { OverlayData overlayData = null; if (!m_OverlayData.TryGetValue(ve, out overlayData)) { overlayData = new OverlayData(ve, kDefaultAlpha); m_OverlayData[ve] = overlayData; } }
public void AddOverlay(VisualElement ve, OverlayContent content = OverlayContent.All) { OverlayData overlayData = null; if (!m_OverlayData.TryGetValue(ve, out overlayData)) { overlayData = new OverlayData(ve, kDefaultHighlightAlpha); m_OverlayData[ve] = overlayData; } overlayData.content = content; }
public void AddOverlay(VisualElement ve) { if (ve == null) { throw new ArgumentNullException("ve"); } OverlayData overlayData = null; if (!m_OverlayData.TryGetValue(ve, out overlayData)) { overlayData = new OverlayData(ve, kDefaultAlpha); m_OverlayData[ve] = overlayData; } }
public void AddOverlay(VisualElement ve) { OverlayData overlayData = null; if (!m_OverlayData.TryGetValue(ve, out overlayData)) { overlayData = new OverlayData(ve, kDefaultRepaintAlpha) { fadeOutRate = kOverlayFadeOut }; m_OverlayData[ve] = overlayData; } else { // Reset alpha overlayData.alpha = overlayData.defaultAlpha; } }
public void AddOverlay(VisualElement ve, VisualElement debugContainer) { if (debugContainer == null) { throw new ArgumentNullException("debugContainer"); } if (ve == null) { throw new ArgumentNullException("ve"); } OverlayData overlayData = null; if (!m_OverlayData.TryGetValue(ve, out overlayData)) { overlayData = new OverlayData(ve, kDefaultAlpha); m_OverlayData[ve] = overlayData; } overlayData.StartFadeOutAnimation(debugContainer, kOverlayFadeOutDuration); }
private void DrawHighlights(MeshGenerationContext mgc, OverlayData od) { var ve = od.element; Rect contentRect = ve.LocalToWorld(ve.contentRect); FillHighlightRects(od.element); var contentFlag = od.content; if ((contentFlag & OverlayContent.Content) == OverlayContent.Content) { DrawRect(mgc, contentRect, kHighlightContentColor, od.alpha); } if ((contentFlag & OverlayContent.Padding) == OverlayContent.Padding) { for (int i = 0; i < 4; i++) { DrawRect(mgc, m_PaddingRects[i], kHighlightPaddingColor, od.alpha); } } if ((contentFlag & OverlayContent.Border) == OverlayContent.Border) { for (int i = 0; i < 4; i++) { DrawRect(mgc, m_BorderRects[i], kHighlightBorderColor, od.alpha); } } if ((contentFlag & OverlayContent.Margin) == OverlayContent.Margin) { for (int i = 0; i < 4; i++) { DrawRect(mgc, m_MarginRects[i], kHighlightMarginColor, od.alpha); } } }
protected abstract void DrawOverlayData(MeshGenerationContext mgc, OverlayData overlayData);
protected override void DrawOverlayData(MeshGenerationContext mgc, OverlayData od) { DrawBorder(mgc, od.element.worldBound, kBoundColor, od.alpha); }
protected override void DrawOverlayData(MeshGenerationContext mgc, OverlayData od) { DrawHighlights(mgc, od); }
protected override void DrawOverlayData(MeshGenerationContext mgc, OverlayData od) { DrawWireframe(mgc, od.element, kUnselectedColor, od.alpha); }
protected abstract void DrawOverlayData(OverlayData overlayData);
protected override void DrawOverlayData(OverlayData od) { DrawBorder(od.element.worldBound, kBoundColor, od.alpha); }
protected override void DrawOverlayData(OverlayData od) { DrawRect(od.element.worldBound, kRepaintColor, od.alpha); DrawBorder(od.element.worldBound, kRepaintColor, od.alpha * 4); }
protected override void DrawOverlayData(OverlayData od) { DrawHighlights(od); }