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 rect1 = new Rect(Mathf.Max(endOfClipPixel, rect.xMin), rect.yMin, rect.width, rect.height); Vector3[] corners = new Vector3[4] { new Vector3(rect1.xMin, rect1.yMin), new Vector3(rect1.xMax, rect1.yMin), new Vector3(rect1.xMax, rect1.yMax), new Vector3(rect1.xMin, rect1.yMax) }; Color color1 = !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); AnimationWindowUtility.DrawRect(corners, color1); TimeArea.DrawVerticalLine(corners[0].x, corners[0].y, corners[3].y, color2); AnimationWindowUtility.DrawLine((Vector2)corners[0], (Vector2)(corners[3] + new Vector3(0.0f, -1f, 0.0f)), color2); }
public static void DrawRangeOfSelection(Rect rect, float startPixel, float endPixel) { Color color = (!EditorGUIUtility.isProSkin) ? Color.gray.AlphaMultiplied(0.25f) : Color.white.AlphaMultiplied(0.1f); startPixel = Mathf.Max(startPixel, rect.xMin); endPixel = Mathf.Max(endPixel, rect.xMin); AnimationWindowUtility.DrawRect(new Vector3[] { new Vector3(startPixel, rect.yMin), new Vector3(endPixel, rect.yMin), new Vector3(endPixel, rect.yMax), new Vector3(startPixel, rect.yMax) }, color); }