docs.unity.cn
    Show / Hide Table of Contents

    Class DrawUtils

    DrawUtils handles drawing of primitives for custom VisualElements.

    Inheritance
    Object
    DrawUtils
    Namespace: Mechatronics.SystemGraph
    Syntax
    public static class DrawUtils

    Methods

    DrawLine(List<UInt16>, List<Vertex>, Vector2, Vector2, Single, Color, Color)

    Draws a line.

    Declaration
    public static void DrawLine(List<ushort> indices, List<Vertex> vertices, Vector2 pointA, Vector2 pointB, float thickness, Color colorA, Color colorB)
    Parameters
    Type Name Description
    List<UInt16> indices

    Indice list in which we'll add the line triangle indices

    List<Vertex> vertices

    Vertice list in which we'll add the line points

    Vector2 pointA

    Start point of the line

    Vector2 pointB

    Stop point of the line

    Single thickness

    Line thickness

    Color colorA

    Start color for gradient

    Color colorB

    End color for gradient

    DrawLineStitched(Single, List<UInt16>, List<Vertex>, Vector2, Vector2, Single, Color, Color)

    Draws the line stitched to the previous line

    Declaration
    public static void DrawLineStitched(float t, List<ushort> indices, List<Vertex> vertices, Vector2 pointA, Vector2 pointB, float thickness, Color colorA, Color colorB)
    Parameters
    Type Name Description
    Single t

    If > 0.0, stitch the previous line

    List<UInt16> indices

    Indice list in which we'll add the line triangle indices

    List<Vertex> vertices

    Vertice list in which we'll add the line points

    Vector2 pointA

    Start point of the line

    Vector2 pointB

    Stop point of the line

    Single thickness

    Line thickness

    Color colorA

    Start color for gradient

    Color colorB

    End color for gradient

    DrawQuadGradient(List<UInt16>, List<Vertex>, Vector2[], Color, Color)

    Draws a quad with color gradient.

    Declaration
    public static void DrawQuadGradient(List<ushort> indices, List<Vertex> vertices, Vector2[] pts, Color color, Color darkColor)
    Parameters
    Type Name Description
    List<UInt16> indices

    The indices.

    List<Vertex> vertices

    The vertices.

    Vector2[] pts

    The points of the quad.

    Color color

    The color of start of gradient.

    Color darkColor

    Color of the dark gradient target.

    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Tuesday, October 18, 2022
    Terms of use