Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
buoylight.c
Go to the documentation of this file.
1class BuoyLight extends PointLightBase
2{
3 const string LIGHT_MAT_ON = "DZ\\structures_sakhal\\industrial\\harbour\\data\\Buoy_01_glass_e.rvmat";
4 protected const string LIGHT_MAT_OFF = "DZ\\structures_sakhal\\industrial\\harbour\\data\\Buoy_01_glass.rvmat";
5 protected const int BASE_BRIGTHNESS = 5;
6
7 protected bool m_IsOn;
8
9 void BuoyLight()
10 {
11 SetBrightnessTo(BASE_BRIGTHNESS);
12 SetRadiusTo(15);
13 SetCastShadow(true);
14 SetVisibleDuringDaylight(false);
15 SetFlareVisible(false);
16 SetAmbientColor(1.0, 0.2, 0.2);
17 SetDiffuseColor(1.0, 0.2, 0.2);
18
19 DimmingConfig dimCfg = new DimmingConfig();
20 dimCfg.AddDimmingPattern({0}, {0.01}, {3}, {0.01}, {1});
21 dimCfg.SetPatternQueueRepeat(-1);
22 EnableDimming(BASE_BRIGTHNESS, dimCfg);
23 }
24
25 override void EOnFrame(IEntity other, float timeSlice)
26 {
27 if (!m_LightDimming)
28 return;
29
30 if (!m_IsOn && m_LightDimming.GetState() == ELightDimmingState.DIMMING)
31 {
32 m_IsOn = true;
33 UpdateLightSourceMaterial(LIGHT_MAT_OFF);
34 }
35 else if (m_IsOn && m_LightDimming.GetState() == ELightDimmingState.BRIGHTENING)
36 {
37 m_IsOn = false;
38 UpdateLightSourceMaterial(LIGHT_MAT_ON);
39 }
40 }
41}
42
44{
45 const string LIGHT_MAT_ON = "DZ\\structures_sakhal\\industrial\\harbour\\data\\Mooring_Buoy_Glass_e.rvmat";
46
48 {
49 SetBrightnessTo(5);
50 SetRadiusTo(10);
51 SetCastShadow(false);
52 SetVisibleDuringDaylight(false);
53 SetAmbientColor(1.0, 0.2, 0.2);
54 SetDiffuseColor(1.0, 0.2, 0.2);
55 }
56}
class BuoyLight extends PointLightBase LIGHT_MAT_ON
void MooringBuoyLight()
Definition buoylight.c:47
override void EOnFrame(IEntity other, float timeSlice)
Definition buoylight.c:25
void BuoyLight()
Definition buoylight.c:9
ELightDimmingState
Definition lightdimming.c:2