public static void DrawRangeOfClip(Rect rect, float startOfClipPixel, float endOfClipPixel) { Color color = (!EditorGUIUtility.isProSkin) ? Color.gray.AlphaMultiplied(0.32f) : Color.gray.RGBMultiplied(0.3f).AlphaMultiplied(0.5f); Color color2 = (!EditorGUIUtility.isProSkin) ? Color.white.RGBMultiplied(0.4f) : Color.white.RGBMultiplied(0.4f); if (startOfClipPixel > rect.xMin) { Rect rect2 = new Rect(rect.xMin, rect.yMin, Mathf.Min(startOfClipPixel - rect.xMin, rect.width), rect.height); Vector3[] array = new Vector3[] { new Vector3(rect2.xMin, rect2.yMin), new Vector3(rect2.xMax, rect2.yMin), new Vector3(rect2.xMax, rect2.yMax), new Vector3(rect2.xMin, rect2.yMax) }; AnimationWindowUtility.DrawRect(array, color); TimeArea.DrawVerticalLine(array[1].x, array[1].y, array[2].y, color2); AnimationWindowUtility.DrawLine(array[1], array[2] + new Vector3(0f, -1f, 0f), color2); } Rect rect3 = new Rect(Mathf.Max(endOfClipPixel, rect.xMin), rect.yMin, rect.width, rect.height); Vector3[] array2 = new Vector3[] { new Vector3(rect3.xMin, rect3.yMin), new Vector3(rect3.xMax, rect3.yMin), new Vector3(rect3.xMax, rect3.yMax), new Vector3(rect3.xMin, rect3.yMax) }; AnimationWindowUtility.DrawRect(array2, color); TimeArea.DrawVerticalLine(array2[0].x, array2[0].y, array2[3].y, color2); AnimationWindowUtility.DrawLine(array2[0], array2[3] + new Vector3(0f, -1f, 0f), color2); }
public static void DrawEndOfClip(Rect rect, float endOfClipPixel) { Rect rect2 = new Rect(Mathf.Max(endOfClipPixel, rect.xMin), rect.yMin, rect.width, rect.height); Vector3[] corners = new Vector3[] { new Vector3(rect2.xMin, rect2.yMin), new Vector3(rect2.xMax, rect2.yMin), new Vector3(rect2.xMax, rect2.yMax), new Vector3(rect2.xMin, rect2.yMax) }; Color color = !EditorGUIUtility.isProSkin ? Color.gray.AlphaMultiplied(0.32f) : Color.gray.RGBMultiplied((float)0.3f).AlphaMultiplied(0.5f); Color color2 = !EditorGUIUtility.isProSkin ? Color.white.RGBMultiplied((float)0.4f) : Color.white.RGBMultiplied((float)0.4f); DrawRect(corners, color); TimeArea.DrawVerticalLine(corners[0].x, corners[0].y, corners[3].y, color2); DrawLine(corners[0], corners[3] + new Vector3(0f, -1f, 0f), color2); }
private void DrawOutOfRangeOverlay(Rect rect, float frameTime) { Color outOfRangeColor = ProfilerTimelineGUI.styles.outOfRangeColor; Color frameDelimiterColor = ProfilerTimelineGUI.styles.frameDelimiterColor; float num = this.m_TimeArea.TimeToPixel(0f, rect); float num2 = this.m_TimeArea.TimeToPixel(frameTime, rect); if (num > rect.xMin) { Rect rect2 = Rect.MinMaxRect(rect.xMin, rect.yMin, Mathf.Min(num, rect.xMax), rect.yMax); EditorGUI.DrawRect(rect2, outOfRangeColor); TimeArea.DrawVerticalLine(rect2.xMax, rect2.yMin, rect2.yMax, frameDelimiterColor); } if (num2 < rect.xMax) { Rect rect3 = Rect.MinMaxRect(Mathf.Max(num2, rect.xMin), rect.yMin, rect.xMax, rect.yMax); EditorGUI.DrawRect(rect3, outOfRangeColor); TimeArea.DrawVerticalLine(rect3.xMin, rect3.yMin, rect3.yMax, frameDelimiterColor); } }
void DrawOutOfRangeOverlay(Rect rect, float frameTime) { var color = styles.outOfRangeColor; var lineColor = styles.frameDelimiterColor; var frameStartPixel = m_TimeArea.TimeToPixel(0f, rect); var frameEndPixel = m_TimeArea.TimeToPixel(frameTime, rect); // Rect shaded shape drawn before selected frame if (frameStartPixel > rect.xMin) { var startRect = Rect.MinMaxRect(rect.xMin, rect.yMin, Mathf.Min(frameStartPixel, rect.xMax), rect.yMax); EditorGUI.DrawRect(startRect, color); TimeArea.DrawVerticalLine(startRect.xMax, startRect.yMin, startRect.yMax, lineColor); } // Rect shaded shape drawn after selected frame if (frameEndPixel < rect.xMax) { var endRect = Rect.MinMaxRect(Mathf.Max(frameEndPixel, rect.xMin), rect.yMin, rect.xMax, rect.yMax); EditorGUI.DrawRect(endRect, color); TimeArea.DrawVerticalLine(endRect.xMin, endRect.yMin, endRect.yMax, lineColor); } }
public static void DrawVerticalSplitLine(Vector2 start, Vector2 end) { TimeArea.DrawVerticalLine(start.x, start.y, end.y, !EditorGUIUtility.isProSkin ? Color.white.RGBMultiplied(0.6f) : Color.white.RGBMultiplied(0.15f)); }
public static void DrawPlayHead(float positionX, float minY, float maxY, float alpha) { TimeArea.DrawVerticalLine(positionX, minY, maxY, Color.red.AlphaMultiplied(alpha)); }