Iuvo Unity 0.5.1
This is library containing a variety of helper classes and extension methods for the Unity gane engine.
GitHub | Iuvo Unity Updates | Creator
Loading...
Searching...
No Matches
IuvoUnity.Extensions.LightExtensions Class Reference

Extension methods for UnityEngine.Light to simplify common property adjustments. More...

Static Public Member Functions

static void SetIntensity (this Light light, float intensity)
 Sets the intensity of the light.
static void SetRange (this Light light, float range)
 Sets the range of the light.
static void SetColor (this Light light, Color color)
 Sets the color of the light.
static void SetBounceIntensity (this Light light, float intensity)
 Sets the bounce intensity of the light.
static void Toggle (this Light light)
 Toggles the enabled state of the light.
static void SetShadowStrength (this Light light, float strength)
 Sets the shadow strength of the light.
static void SetShadowResolution (this Light light, LightShadowResolution resolution)
 Sets the shadow resolution of the light.
static void SetShadowBias (this Light light, float bias)
 Sets the shadow bias of the light.
static void SetShadowNormalBias (this Light light, float normalBias)
 Sets the shadow normal bias of the light.
static void SetColorTemperature (this Light light, float temperature)
 Sets the color temperature of the light.
static void SetCullingMask (this Light light, LayerMask cullingMask)
 Sets the culling mask of the light.
static void SetFlare (this Light light, Flare flare)
 Sets the flare of the light.
static void SetSpotAngle (this Light light, float angle)
 Sets the spot angle of the light.
static void SetCookie (this Light light, Texture cookie)
 Sets the cookie texture of the light.
static void SetRenderMode (this Light light, LightRenderMode renderMode)
 Sets the render mode of the light.
static void SetAreaSize (this Light light, Vector2 size)
 Sets the area size of the light (for area lights).

Detailed Description

Extension methods for UnityEngine.Light to simplify common property adjustments.

Member Function Documentation

◆ SetAreaSize()

void IuvoUnity.Extensions.LightExtensions.SetAreaSize ( this Light light,
Vector2 size )
static

Sets the area size of the light (for area lights).

Parameters
lightThe light to modify.
sizeThe desired area size as a Vector2.
193 {
194 if (light == null) return;
195 light.areaSize = size;
196 }

◆ SetBounceIntensity()

void IuvoUnity.Extensions.LightExtensions.SetBounceIntensity ( this Light light,
float intensity )
static

Sets the bounce intensity of the light.

Parameters
lightThe light to modify.
intensityThe desired bounce intensity.
54 {
55 if (light == null) return;
56 light.bounceIntensity = intensity;
57 }

◆ SetColor()

void IuvoUnity.Extensions.LightExtensions.SetColor ( this Light light,
Color color )
static

Sets the color of the light.

Parameters
lightThe light to modify.
colorThe desired color.
43 {
44 if (light == null) return;
45 light.color = color;
46 }

◆ SetColorTemperature()

void IuvoUnity.Extensions.LightExtensions.SetColorTemperature ( this Light light,
float temperature )
static

Sets the color temperature of the light.

Parameters
lightThe light to modify.
temperatureThe desired color temperature.
127 {
128 if (light == null) return;
129 light.colorTemperature = temperature;
130 }

◆ SetCookie()

void IuvoUnity.Extensions.LightExtensions.SetCookie ( this Light light,
Texture cookie )
static

Sets the cookie texture of the light.

Parameters
lightThe light to modify.
cookieThe desired cookie texture.
171 {
172 if (light == null) return;
173 light.cookie = cookie;
174 }

◆ SetCullingMask()

void IuvoUnity.Extensions.LightExtensions.SetCullingMask ( this Light light,
LayerMask cullingMask )
static

Sets the culling mask of the light.

Parameters
lightThe light to modify.
cullingMaskThe desired culling mask.
138 {
139 if (light == null) return;
140 light.cullingMask = cullingMask;
141 }

◆ SetFlare()

void IuvoUnity.Extensions.LightExtensions.SetFlare ( this Light light,
Flare flare )
static

Sets the flare of the light.

Parameters
lightThe light to modify.
flareThe desired flare object.
149 {
150 if (light == null) return;
151 light.flare = flare;
152 }

◆ SetIntensity()

void IuvoUnity.Extensions.LightExtensions.SetIntensity ( this Light light,
float intensity )
static

Sets the intensity of the light.

Parameters
lightThe light to modify.
intensityThe desired intensity value.
21 {
22 if (light == null) return;
23 light.intensity = intensity;
24 }

◆ SetRange()

void IuvoUnity.Extensions.LightExtensions.SetRange ( this Light light,
float range )
static

Sets the range of the light.

Parameters
lightThe light to modify.
rangeThe desired range value.
32 {
33 if (light == null) return;
34 light.range = range;
35 }

◆ SetRenderMode()

void IuvoUnity.Extensions.LightExtensions.SetRenderMode ( this Light light,
LightRenderMode renderMode )
static

Sets the render mode of the light.

Parameters
lightThe light to modify.
renderModeThe desired render mode.
182 {
183 if (light == null) return;
184 light.renderMode = renderMode;
185 }

◆ SetShadowBias()

void IuvoUnity.Extensions.LightExtensions.SetShadowBias ( this Light light,
float bias )
static

Sets the shadow bias of the light.

Parameters
lightThe light to modify.
biasThe desired shadow bias.
101 {
102 if (light == null) return;
103 light.shadowBias = bias;
104 }

◆ SetShadowNormalBias()

void IuvoUnity.Extensions.LightExtensions.SetShadowNormalBias ( this Light light,
float normalBias )
static

Sets the shadow normal bias of the light.

Parameters
lightThe light to modify.
normalBiasThe desired shadow normal bias.
112 {
113 if (light == null) return;
114 light.shadowNormalBias = normalBias;
115 }

◆ SetShadowResolution()

void IuvoUnity.Extensions.LightExtensions.SetShadowResolution ( this Light light,
LightShadowResolution resolution )
static

Sets the shadow resolution of the light.

Parameters
lightThe light to modify.
resolutionThe desired shadow resolution.
90 {
91 if (light == null) return;
92 light.shadowResolution = resolution;
93 }

◆ SetShadowStrength()

void IuvoUnity.Extensions.LightExtensions.SetShadowStrength ( this Light light,
float strength )
static

Sets the shadow strength of the light.

Parameters
lightThe light to modify.
strengthThe desired shadow strength.
79 {
80 if (light == null) return;
81 light.shadowStrength = strength;
82 }

◆ SetSpotAngle()

void IuvoUnity.Extensions.LightExtensions.SetSpotAngle ( this Light light,
float angle )
static

Sets the spot angle of the light.

Parameters
lightThe light to modify.
angleThe desired spot angle.
160 {
161 if (light == null) return;
162 light.spotAngle = angle;
163 }

◆ Toggle()

void IuvoUnity.Extensions.LightExtensions.Toggle ( this Light light)
static

Toggles the enabled state of the light.

Parameters
lightThe light to toggle.
64 {
65 if (light == null) return;
66 light.enabled = !light.enabled;
67 }

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