Terrain Engine 2D  1.10
A 2D Block Engine
TerrainEngine2D.LightSystem Class Reference

A basic 2D block lighting system More...

Inheritance diagram for TerrainEngine2D.LightSystem:
TerrainEngine2D.MonoBehaviourSingleton< LightSystem >

Public Member Functions

void OnEnable ()
 
void OnDisable ()
 
void Start ()
 
void Initialize (World world)
 Setup the light map data More...
 
void UpdateLightSystem ()
 Set the light system for an update More...
 
void GenerateShadowMask (Color32[,] lightMap2D)
 Generate the shadow mask More...
 
void UpdateLighting (int posX, int posY, int width, int height)
 Update the lightmap data when blocks change in the lightLayer More...
 

Protected Member Functions

override void Awake ()
 

Properties

int LightBleed [get]
 The number of blocks from the edge of the terrain for light to illuminate Higher value means more blocks illuminated further from the edge of the terrain More...
 
- Properties inherited from TerrainEngine2D.MonoBehaviourSingleton< LightSystem >
static T Instance [get]
 

Detailed Description

A basic 2D block lighting system

Member Function Documentation

◆ Awake()

override void TerrainEngine2D.LightSystem.Awake ( )
protectedvirtual

◆ GenerateShadowMask()

void TerrainEngine2D.LightSystem.GenerateShadowMask ( Color32  lightMap2D[,])

Generate the shadow mask

Parameters
lightMap2DThe light data for the whole world

◆ Initialize()

void TerrainEngine2D.LightSystem.Initialize ( World  world)

Setup the light map data

Parameters
worldReference to the world

◆ OnDisable()

void TerrainEngine2D.LightSystem.OnDisable ( )

◆ OnEnable()

void TerrainEngine2D.LightSystem.OnEnable ( )

◆ Start()

void TerrainEngine2D.LightSystem.Start ( )

◆ UpdateLighting()

void TerrainEngine2D.LightSystem.UpdateLighting ( int  posX,
int  posY,
int  width,
int  height 
)

Update the lightmap data when blocks change in the lightLayer

Parameters
posXThe x position of the block change
posYThe y position of the block change
widthThe width of the block (in block units)
heightThe height of the block (in block units)

◆ UpdateLightSystem()

void TerrainEngine2D.LightSystem.UpdateLightSystem ( )

Set the light system for an update

Property Documentation

◆ LightBleed

int TerrainEngine2D.LightSystem.LightBleed
get

The number of blocks from the edge of the terrain for light to illuminate Higher value means more blocks illuminated further from the edge of the terrain


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