Sinespace Client  2023.2.17543
Client-side scripting for Sinespace
SineSpace.Scripting.Components.SLineRenderer Class Reference
Inheritance diagram for SineSpace.Scripting.Components.SLineRenderer:
ScriptClassComponent< LineRenderer >

Public Member Functions

void SetPosition (int index, SVector position)
 Set the position of a vertex in the line. More...
 
SVector GetPosition (int index)
 Get the position of a vertex in the line More...
 
void SetPositions (SVector[] positions)
 Set the positions of all vertices in the line. More...
 
SVector[] GetPositions ()
 Set the positions of all vertices in the line. More...
 
void SetWidth (float start, float end)
 Set width at start and end More...
 
void SetColors (SColor start, SColor end)
 Set color at start and end (Line shader necessary) More...
 

Properties

bool Enabled [get, set]
 Makes the rendered visible if enabled. More...
 
bool ReceiveShadows [get, set]
 Enable this option to make the line display any shadows that are cast upon it. More...
 
bool IsVisible [get]
 To check if this renderer is visible. More...
 
bool CastShadows [get, set]
 Specify if and how the line casts shadows when a suitable Light shine on it. More...
 
bool MotionVectors [get, set]
 Specifies whether this renderer has a per-object motion vector pass. If set to true, this object will have a per-object motion vector pass rendered. More...
 
bool UseLightProbes [get, set]
 The light probe interpolation type. More...
 
float StartWidth [get, set]
 Set the width at the start of the line. More...
 
float EndWidth [get, set]
 Set the width at the end of the line. More...
 
float WidthMultiplier [get, set]
 Set an overall multiplier that is applied to the LineRenderer.widthCurve to get the final width of the line. More...
 
SColor StartColor [get, set]
 Set the color at the start of the line. More...
 
SColor EndColor [get, set]
 Set the color at the end of the line. More...
 
int PositionCount [get, set]
 Set/get the number of vertices. More...
 
bool UseWorldSpace [get, set]
 If enabled, the points are considered as world space coordinates. If disabled, they are local to the transform of the GameObject to which this component is attached. More...
 
bool Loop [get, set]
 Enable this to connect the first and last positions of the line, and form a closed loop. More...
 
int NumCornerVertices [get, set]
 Set this to a value greater than 0, to get rounded corners between each segment of the line. More...
 
int NumCapVertices [get, set]
 Set this to a value greater than 0, to get rounded corners on each end of the line. More...
 
int TextureMode [get, set]
 Control how the Texture is applied to the line. (0-3) More...
 
int Alignment [get, set]
 Set the direction that the line faces. (0 or 1) More...
 
- Properties inherited from ScriptClassComponent< LineRenderer >
SGameObject GameObject [get]
 Return the GameObject which component added. More...
 

Member Function Documentation

◆ GetPosition()

SVector SineSpace.Scripting.Components.SLineRenderer.GetPosition ( int  index)

Get the position of a vertex in the line

lineRenderer = Space.Scene.Find(“Line”).LineRenderer
&ndash;get the LineRenderer component.
zeroPointPosition = lineRenderer.GetPosition(0)
&ndash;get the point at index 0 and set the point position after change position
Space.Log(zeroPointPosition.ToString())

◆ GetPositions()

SVector [] SineSpace.Scripting.Components.SLineRenderer.GetPositions ( )

Set the positions of all vertices in the line.

lineRenderer = Space.Scene.Find(“Line”).LineRenderer
&ndash;get the LineRenderer component.
positions = lineRenderer.GetPositions()
&ndash;get positions and output positions information.
for k,v in pairs(positions) do
Space.Log(k..v.ToString())
end

◆ SetColors()

void SineSpace.Scripting.Components.SLineRenderer.SetColors ( SColor  start,
SColor  end 
)

Set color at start and end (Line shader necessary)

lineRenderer = Space.Scene.Find(“Line”).LineRenderer
&ndash;get the LineRenderer component.
lineRenderer.SetColors(Color.New(1,0,0,1),Color.New(0,1,0,1))
&ndash;set start color as pure red and end color as pure green.

◆ SetPosition()

void SineSpace.Scripting.Components.SLineRenderer.SetPosition ( int  index,
SVector  position 
)

Set the position of a vertex in the line.

lineRenderer = Space.Scene.Find(“Line”).LineRenderer
&ndash;get the LineRenderer component.
zeroPointPosition = lineRenderer.GetPosition(0)
&ndash;get the point at 0 and set new point position after change position
zeroPointPosition.X =zeroPointPosition.X+1
lineRenderer.SetPosition(0,zeroPointPosition)

◆ SetPositions()

void SineSpace.Scripting.Components.SLineRenderer.SetPositions ( SVector[]  positions)

Set the positions of all vertices in the line.

lineRenderer = Space.Scene.Find(“Line”).LineRenderer
&ndash;get the LineRenderer component
positions = lineRenderer.GetPositions()
&ndash;get the positions and modify, then set them to line renderer
for k,v in pairs(positions) do
v.X = v.X+1
end
lineRenderer.SetPositions(positions)

◆ SetWidth()

void SineSpace.Scripting.Components.SLineRenderer.SetWidth ( float  start,
float  end 
)

Set width at start and end

lineRenderer = Space.Scene.Find(“Line”).LineRenderer
&ndash;get the LineRenderer component.
lineRenderer.SetWidth(0,3)
&ndash;set start width as 0 and end width as 3.

Property Documentation

◆ Alignment

int SineSpace.Scripting.Components.SLineRenderer.Alignment
getset

Set the direction that the line faces. (0 or 1)

lineRenderer = Space.Scene.Find(“Line”).LineRenderer
&ndash;get the LineRenderer component
lineRenderer.Alignment = 1
&ndash;set alignment to transform z

◆ CastShadows

bool SineSpace.Scripting.Components.SLineRenderer.CastShadows
getset

Specify if and how the line casts shadows when a suitable Light shine on it.

lineRenderer = Space.Scene.Find(“Line”).LineRenderer
&ndash;get the LineRenderer component.
lineRenderer.CastShadows = false
&ndash;make this renderer unable to cast shadows.

◆ Enabled

bool SineSpace.Scripting.Components.SLineRenderer.Enabled
getset

Makes the rendered visible if enabled.

lineRenderer = Space.Scene.Find("Line").LineRenderer
&ndash;get the LineRenderer component.
lineRenderer.Enabled = false
&ndash;disable line renderer to make line invisible

◆ EndColor

SColor SineSpace.Scripting.Components.SLineRenderer.EndColor
getset

Set the color at the end of the line.

lineRenderer = Space.Scene.Find(“Line”).LineRenderer
&ndash;get the LineRenderer component
lineRenderer.EndColor = Color.New(0,1,0,1)
&ndash;set end color to pure green.

◆ EndWidth

float SineSpace.Scripting.Components.SLineRenderer.EndWidth
getset

Set the width at the end of the line.

lineRenderer = Space.Scene.Find(“Line”).LineRenderer
&ndash;get the LineRenderer component.
lineRenderer.EndWidth = 3
&ndash;set end width to 3.

◆ IsVisible

bool SineSpace.Scripting.Components.SLineRenderer.IsVisible
get

To check if this renderer is visible.

lineRenderer = Space.Scene.Find("Line").LineRenderer
&ndash;get the LineRenderer component on your line object
Space.Log(“”..lineRenderer.IsVisible)
&ndash;output this renderer visible or not in your camera

◆ Loop

bool SineSpace.Scripting.Components.SLineRenderer.Loop
getset

Enable this to connect the first and last positions of the line, and form a closed loop.

lineRenderer = Space.Scene.Find(“Line”).LineRenderer
&ndash;get the LineRenderer component on your line object
lineRenderer.Loop = true
&ndash;set loop as true.

◆ MotionVectors

bool SineSpace.Scripting.Components.SLineRenderer.MotionVectors
getset

Specifies whether this renderer has a per-object motion vector pass. If set to true, this object will have a per-object motion vector pass rendered.

lineRenderer = Space.Scene.Find(“Line”).LineRenderer
&ndash;get the LineRenderer component.
lineRenderer.MotionVectors = true
&ndash;enable per object motion.

◆ NumCapVertices

int SineSpace.Scripting.Components.SLineRenderer.NumCapVertices
getset

Set this to a value greater than 0, to get rounded corners on each end of the line.

lineRenderer = Space.Scene.Find(“Line”).LineRenderer
&ndash;get the LineRenderer component
lineRenderer.NumCapVertices = 27
&ndash;set cap vertices to 27 make end of the line smooth

◆ NumCornerVertices

int SineSpace.Scripting.Components.SLineRenderer.NumCornerVertices
getset

Set this to a value greater than 0, to get rounded corners between each segment of the line.

lineRenderer = Space.Scene.Find(“Line”).LineRenderer
&ndash;get the LineRenderer component
lineRenderer. NumCornerVertices = 18
&ndash;set corner vertices to 18.

◆ PositionCount

int SineSpace.Scripting.Components.SLineRenderer.PositionCount
getset

Set/get the number of vertices.

lineRenderer = Space.Scene.Find(“Line”).LineRenderer
&ndash;get the LineRenderer component
Space.Log(lineRenderer.PositionCount)
&ndash;show the number of vertices

◆ ReceiveShadows

bool SineSpace.Scripting.Components.SLineRenderer.ReceiveShadows
getset

Enable this option to make the line display any shadows that are cast upon it.

lineRenderer = Space.Scene.Find("Line").LineRenderer
&ndash;get the LineRenderer component.
lineRenderer.ReceiveShadows = false
&ndash;make this renderer unable to receive shadows.

◆ StartColor

SColor SineSpace.Scripting.Components.SLineRenderer.StartColor
getset

Set the color at the start of the line.

lineRenderer = Space.Scene.Find(“Line”).LineRenderer
&ndash;get the LineRenderer component.
lineRenderer.StartColor = Color.New(1,0,0,1)
&ndash;set start color to pure red.

◆ StartWidth

float SineSpace.Scripting.Components.SLineRenderer.StartWidth
getset

Set the width at the start of the line.

lineRenderer = Space.Scene.Find(“Line”).LineRenderer
&ndash;get the LineRenderer component.
lineRenderer.StartWidth = 0
&ndash;set start width to 0.

◆ TextureMode

int SineSpace.Scripting.Components.SLineRenderer.TextureMode
getset

Control how the Texture is applied to the line. (0-3)

lineRenderer = Space.Scene.Find(“Line”).LineRenderer
&ndash;get the LineRenderer component
lineRenderer.TextureMode = 3
&ndash;set texture mode as repeat per segment

◆ UseLightProbes

bool SineSpace.Scripting.Components.SLineRenderer.UseLightProbes
getset

The light probe interpolation type.

lineRenderer = Space.Scene.Find(“Line”).LineRenderer
&ndash;get the LineRenderer component.
lineRenderer.UseLightProbes = true
&ndash;enable use light probes,

◆ UseWorldSpace

bool SineSpace.Scripting.Components.SLineRenderer.UseWorldSpace
getset

If enabled, the points are considered as world space coordinates. If disabled, they are local to the transform of the GameObject to which this component is attached.

lineRenderer = Space.Scene.Find(“Line”).LineRenderer
&ndash;get the LineRenderer component
lineRenderer.UseWorldSpace = true
&ndash;set world use space as true

◆ WidthMultiplier

float SineSpace.Scripting.Components.SLineRenderer.WidthMultiplier
getset

Set an overall multiplier that is applied to the LineRenderer.widthCurve to get the final width of the line.

lineRenderer = Space.Scene.Find(“Line”).LineRenderer
&ndash;get the LineRenderer component.
lineRenderer.WidthMultiplier = 3
&ndash;set widthmultiplier to 3.
SineSpace.Scripting.Components.SLineRenderer.NumCornerVertices
int NumCornerVertices
Set this to a value greater than 0, to get rounded corners between each segment of the line.
Definition: SLineRenderer.cs:436