UI Line Renderer

πŸ“ UILineRenderer Class

A UI component for rendering customizable lines with width curves, color gradients, and rounded caps/corners.

Namespace: Esper.SkillWeb.UI.UGUI Inherits from: MaskableGraphic Type: class


πŸ“¦ Fields

Access
Field
Type
Description

protected

cachedMaterial

Material

The instanced material cached when materialForRendering is called.


πŸ”§ Properties

Access
Property
Type
Description

public

material

Material

Gets or sets the material used for rendering.

public

LineWidth

float

Gets or sets the width of the line.

public

WidthCurve

AnimationCurve

Gets or sets the curve that controls line width along its length.

public

ColorGradient

Gradient

Gets or sets the gradient that controls line color along its length.

public

CornerVertices

int

Gets or sets the number of vertices used for rounded corners.

public

EndCapVertices

int

Gets or sets the number of vertices used for rounded end caps.

public

Loop

bool

Gets or sets whether the line should connect the last point to the first point.

public

mainTexture

Texture

Gets the main texture from the current material.

public

positionCount

int

Gets or sets the number of positions in the line.

public

materialForRendering

Material

Gets the material that will be used for rendering.


🧰 Methods

Access
Method
Returns
Description

public

GetCurrentMaterial()

Material

Gets the current material that should be used for rendering.

public

SetPosition(int, Vector2)

void

Sets the position of a specific point in the line.

public

GetPosition(int)

Vector2

Gets the position of a specific point in the line.

public

SetPositions(Vector2[])

void

Sets all positions in the line from an array.

public

SetPositions(List<Vector2>)

void

Sets all positions in the line from a list.

public

GetPositions(Vector2[])

int

Gets all positions in the line and copies them to the provided array.

public

AddPosition(Vector2)

void

Adds a new position to the end of the line.

public

RemovePosition(int)

void

Removes a position at the specified index.

public

ClearPositions()

void

Removes all positions from the line.

public

SetPosition3D(int, Vector3)

void

Sets the position of a specific point using a 3D vector (Z value is ignored).

public

SetPositions3D(Vector3[])

void

Sets all positions in the line from a 3D array (Z values are ignored).

protected

OnPopulateMesh(VertexHelper)

void

Populates the mesh with line vertices and triangles.

Last updated