public static DrawPolyLineWithShadow ( Color shadowColor, Vector2 screenOffset ) : void | ||
shadowColor | Color | |
screenOffset | Vector2 | |
return | void |
public static void DrawPolyLineWithShadow(Color shadowColor, Vector2 screenOffset, params Vector3[] points)
{
Camera current = Camera.current;
if ((current != null) && (Event.current.type == EventType.Repaint))
{
if (s_TempVectors.Length != points.Length)
{
s_TempVectors = new Vector3[points.Length];
}
for (int i = 0; i < points.Length; i++)
{
s_TempVectors[i] = current.ScreenToWorldPoint(current.WorldToScreenPoint(points[i]) + screenOffset);
}
Color color = Handles.color;
shadowColor.a *= color.a;
Handles.color = shadowColor;
Handles.DrawPolyLine(s_TempVectors);
Handles.color = color;
Handles.DrawPolyLine(points);
}
}
public static void RenderRectWithShadow(bool active, params Vector3[] corners) { Vector3[] vector3Array = new Vector3[5] { corners[0], corners[1], corners[2], corners[3], corners[0] }; Color color = Handles.color; Handles.color = new Color(1f, 1f, 1f, !active ? 0.5f : 1f); RectHandles.DrawPolyLineWithShadow(new Color(0.0f, 0.0f, 0.0f, !active ? 0.5f : 1f), new Vector2(1f, -1f), vector3Array); Handles.color = color; }