Terrain Engine 2D  1.10
A 2D Block Engine
TerrainEngine2D.Lighting.LightSource Class Reference

A source of light More...

Inheritance diagram for TerrainEngine2D.Lighting.LightSource:
TerrainEngine2D.Lighting.FloodLight TerrainEngine2D.Lighting.RaycastLight TerrainEngine2D.Lighting.AdvancedRaycastLight

Public Member Functions

void UpdateLight ()
 Update the light mesh More...
 

Public Attributes

Color LightColor = new Color32(237, 231, 217, 173)
 Color of the light source More...
 
int LightRadius = 10
 Distance light can travel More...
 
int SmoothingIterations
 Number of points to average across the light mesh for smoothing More...
 
float FlickerRate = 0
 Speed of light flickering More...
 
float FlickerRateVary = 0.1f
 Amount the flicker light rate varies More...
 
float FlickerScalingRadius = 0.1f
 The flicker scaling radius More...
 

Protected Member Functions

virtual void OnEnable ()
 
virtual void Awake ()
 
virtual void Start ()
 
virtual void LateUpdate ()
 
virtual void CalculateLighting ()
 Calculate the light mesh points More...
 
virtual void SmoothPoints ()
 Smooth the light mesh vertices More...
 
virtual void CreateMesh ()
 Add the light points to the mesh More...
 
void UpdateMesh ()
 Update the light mesh More...
 
Vector2 AngleToDirection (float angleInDegrees, bool globalAngle)
 Converts a given angle in degrees to a direction More...
 

Protected Attributes

World world
 
List< Vector2 > lightPoints
 
Mesh mesh
 
List< Vector3 > vertices
 
List< int > triangles
 
List< Vector2 > uvs
 
List< Color32 > colors32
 

Properties

bool Dynamic [get]
 Update the light dynamically More...
 

Detailed Description

A source of light

Member Function Documentation

◆ AngleToDirection()

Vector2 TerrainEngine2D.Lighting.LightSource.AngleToDirection ( float  angleInDegrees,
bool  globalAngle 
)
protected

Converts a given angle in degrees to a direction

Parameters
angleInDegreesThe clockwise angle from the y axis
globalAngleWhether to use the global angle or local
Returns

◆ Awake()

virtual void TerrainEngine2D.Lighting.LightSource.Awake ( )
protectedvirtual

◆ CalculateLighting()

virtual void TerrainEngine2D.Lighting.LightSource.CalculateLighting ( )
protectedvirtual

◆ CreateMesh()

virtual void TerrainEngine2D.Lighting.LightSource.CreateMesh ( )
protectedvirtual

◆ LateUpdate()

virtual void TerrainEngine2D.Lighting.LightSource.LateUpdate ( )
protectedvirtual

◆ OnEnable()

virtual void TerrainEngine2D.Lighting.LightSource.OnEnable ( )
protectedvirtual

◆ SmoothPoints()

virtual void TerrainEngine2D.Lighting.LightSource.SmoothPoints ( )
protectedvirtual

Smooth the light mesh vertices

Reimplemented in TerrainEngine2D.Lighting.FloodLight, and TerrainEngine2D.Lighting.RaycastLight.

◆ Start()

virtual void TerrainEngine2D.Lighting.LightSource.Start ( )
protectedvirtual

◆ UpdateLight()

void TerrainEngine2D.Lighting.LightSource.UpdateLight ( )

Update the light mesh

◆ UpdateMesh()

void TerrainEngine2D.Lighting.LightSource.UpdateMesh ( )
protected

Update the light mesh

Member Data Documentation

◆ colors32

List<Color32> TerrainEngine2D.Lighting.LightSource.colors32
protected

◆ FlickerRate

float TerrainEngine2D.Lighting.LightSource.FlickerRate = 0

Speed of light flickering

◆ FlickerRateVary

float TerrainEngine2D.Lighting.LightSource.FlickerRateVary = 0.1f

Amount the flicker light rate varies

◆ FlickerScalingRadius

float TerrainEngine2D.Lighting.LightSource.FlickerScalingRadius = 0.1f

The flicker scaling radius

◆ LightColor

Color TerrainEngine2D.Lighting.LightSource.LightColor = new Color32(237, 231, 217, 173)

Color of the light source

◆ lightPoints

List<Vector2> TerrainEngine2D.Lighting.LightSource.lightPoints
protected

◆ LightRadius

int TerrainEngine2D.Lighting.LightSource.LightRadius = 10

Distance light can travel

◆ mesh

Mesh TerrainEngine2D.Lighting.LightSource.mesh
protected

◆ SmoothingIterations

int TerrainEngine2D.Lighting.LightSource.SmoothingIterations

Number of points to average across the light mesh for smoothing

◆ triangles

List<int> TerrainEngine2D.Lighting.LightSource.triangles
protected

◆ uvs

List<Vector2> TerrainEngine2D.Lighting.LightSource.uvs
protected

◆ vertices

List<Vector3> TerrainEngine2D.Lighting.LightSource.vertices
protected

◆ world

World TerrainEngine2D.Lighting.LightSource.world
protected

Property Documentation

◆ Dynamic

bool TerrainEngine2D.Lighting.LightSource.Dynamic
get

Update the light dynamically


The documentation for this class was generated from the following file: