2DDL PRO  1.3.6
DynamicLight2D.DynamicLight Class Reference
Inheritance diagram for DynamicLight2D.DynamicLight:

Classes

class  Comparer
 Vert sorting comparer
 
class  Vert
 SIngle Vert
 
class  VertItem
 Holds the Verts for this collider
 

Public Types

enum  LightMode { Normal, Fast }
 enum for all types of light perform More...
 

Public Member Functions

delegate void OnReachedDelegate (GameObject[] go)
 Occurs when on reached game objects. More...
 
delegate void InsideFieldOfViewDelegate (GameObject[] go)
 Listener. Is called when caster just in of sight of the current 2DLight

Returns
Array of GameObjects
More...
 
delegate void OnEnterFieldOfViewDelegate (GameObject go)
 
delegate void OnExitFieldOfViewDelegate (GameObject go)
 
Vector2 getMaxFromAllVerts ()
 
Vector2 getMinFromAllVerts ()
 
void setMainMaterial (Material m)
 Sets the main material. More...
 
void setLayerMask ()
 Sets the layer mask. More...
 
int getLayerNumberFromLayerMask ()
 Gets the layer number from layer mask. More...
 
int getLayerNumberFromLayerMask (int layerValue)
 Gets the layer number from layer mask. More...
 
void setMagRange (float mag)
 Sets the internal _MagRange. More...
 
void Rebuild ()
 Rebuild all mesh. More...
 
void GetCollidersOnScene ()
 Get all vertices, and init arrays. More...
 
void GetCollidersOnSceneNonStatic ()
 Gets the colliders on scene non static. More...
 
void addColliderToScene (Collider2D newColl)
 Adds specific collider to scene (work with static scenes). More...
 

Public Attributes

string Version
 The version in string format. More...
 
bool SolidColor = false
 If light uses solid color. More...
 
Color32 LightColor
 The color of the light. More...
 
Material LightMaterial
 The light material. More...
 
float strokeRender = 0
 Stroke revealed when render as stencil shader. Is a offset of collider towards to direction 2DLight -> caster. More...
 
float LightRadius = 20f
 The light radius. More...
 
int Segments = 9
 The segments of light mesh. More...
 
LayerMask Layer
 The layer that light uses for interact with casters. More...
 
bool notifyGameObjectsReached = false
 Enabled suscription to "OnReachedDelegate" event. More...
 
bool intelliderConvex = false
 Use intellider convex (mesh optimizer). More...
 
bool staticScene = true
 Don't check for new colliders every frame. More...
 
LightMode lightMode
 
bool recalculateNormals = true
 Forces to recalculate normals in the mesh build. More...
 
bool flipXYtoXZ = false
 
bool debugLines = true
 Show debug lines More...
 
int vertexWorking
 The sort order. More...
 
float RangeAngle = 360f
 

Static Public Attributes

static bool reloadMeshes = false
 forces to reload light mesh in the next frame update More...
 

Events

InsideFieldOfViewDelegate InsideFieldOfViewEvent
 Suscribe to this event for receive array of game More...
 
OnEnterFieldOfViewDelegate OnEnterFieldOfView
 
OnExitFieldOfViewDelegate OnExitFieldOfView
 

Member Enumeration Documentation

enum for all types of light perform

Member Function Documentation

void DynamicLight2D.DynamicLight.addColliderToScene ( Collider2D  newColl)

Adds specific collider to scene (work with static scenes).

void DynamicLight2D.DynamicLight.GetCollidersOnScene ( )

Get all vertices, and init arrays.

void DynamicLight2D.DynamicLight.GetCollidersOnSceneNonStatic ( )

Gets the colliders on scene non static.

int DynamicLight2D.DynamicLight.getLayerNumberFromLayerMask ( )

Gets the layer number from layer mask.

Returns
The layer number from layer mask.
int DynamicLight2D.DynamicLight.getLayerNumberFromLayerMask ( int  layerValue)

Gets the layer number from layer mask.

Returns
The layer number from layer mask.
Parameters
layerValue from layerMask.valueLayer value.
delegate void DynamicLight2D.DynamicLight.InsideFieldOfViewDelegate ( GameObject[]  go)

Listener. Is called when caster just in of sight of the current 2DLight

Returns
Array of GameObjects

delegate void DynamicLight2D.DynamicLight.OnEnterFieldOfViewDelegate ( GameObject  go)

Listener. Is called when caster just enter in field of view of the current 2DLight

Returns
GameObject
delegate void DynamicLight2D.DynamicLight.OnExitFieldOfViewDelegate ( GameObject  go)

Listener. Is called when caster just out of sight of the current 2DLight

Returns
GameObject
delegate void DynamicLight2D.DynamicLight.OnReachedDelegate ( GameObject[]  go)

Occurs when on reached game objects.

void DynamicLight2D.DynamicLight.Rebuild ( )

Rebuild all mesh.

void DynamicLight2D.DynamicLight.setLayerMask ( )

Sets the layer mask.

void DynamicLight2D.DynamicLight.setMagRange ( float  mag)

Sets the internal _MagRange.

Parameters
magMag.
void DynamicLight2D.DynamicLight.setMainMaterial ( Material  m)

Sets the main material.

Parameters
mM.

Member Data Documentation

bool DynamicLight2D.DynamicLight.debugLines = true

Show debug lines

bool DynamicLight2D.DynamicLight.intelliderConvex = false

Use intellider convex (mesh optimizer).

LayerMask DynamicLight2D.DynamicLight.Layer

The layer that light uses for interact with casters.

Color32 DynamicLight2D.DynamicLight.LightColor

The color of the light.

Material DynamicLight2D.DynamicLight.LightMaterial

The light material.

float DynamicLight2D.DynamicLight.LightRadius = 20f

The light radius.

bool DynamicLight2D.DynamicLight.notifyGameObjectsReached = false

Enabled suscription to "OnReachedDelegate" event.

bool DynamicLight2D.DynamicLight.recalculateNormals = true

Forces to recalculate normals in the mesh build.

bool DynamicLight2D.DynamicLight.reloadMeshes = false
static

forces to reload light mesh in the next frame update

int DynamicLight2D.DynamicLight.Segments = 9

The segments of light mesh.

bool DynamicLight2D.DynamicLight.SolidColor = false

If light uses solid color.

bool DynamicLight2D.DynamicLight.staticScene = true

Don't check for new colliders every frame.

float DynamicLight2D.DynamicLight.strokeRender = 0

Stroke revealed when render as stencil shader. Is a offset of collider towards to direction 2DLight -> caster.

string DynamicLight2D.DynamicLight.Version

The version in string format.

int DynamicLight2D.DynamicLight.vertexWorking

The sort order.

Event Documentation

InsideFieldOfViewDelegate DynamicLight2D.DynamicLight.InsideFieldOfViewEvent

Suscribe to this event for receive array of game


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