DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
VehicleLightsComponent.c
См. документацию.
12
14{
15 string m_Point;
17
20
22 {
23 m_LightProfile = profile;
24 }
25}
26
28{
29 const int NORMAL = 0;
30 const int BRAKE = 1;
31 const int REVERSE = 2;
32 const int REVERSE_BRAKE = 3;
33}
34
35class VehicleLightMode
36{
37 const int SEGREGATED = 0;
38 const int AGGREGATED = 1;
39}
40
42{
44
47
55
60
62 {
63 m_LightMap.Set(name, data);
64 }
65
67 {
69 if (!data || (data && data.Count() == 0))
70 {
71 ErrorEx(string.Format("No VehicleLightSelectionData available for key:%1", name));
72 return;
73 }
74
75 foreach (VehicleLightSelectionData selectionData : data)
76 {
77 string material = m_Parent.ConfigGetString(selectionData.m_MaterialName);
78 if (!material.Empty)
79 m_Parent.SetObjectMaterial(selectionData.m_SelectionId, material);
80 }
81 }
82
83 void EnableLight(string name)
84 {
86 if (data)
87 {
88 if (!data.m_Light)
89 {
91 light.SetLightProfile(data.m_LightProfile);
92
93 data.m_Light = light;
94 }
95 #ifdef DIAG_DEVELOPER
96 else
97 ErrorEx(string.Format("m_Light is already assigned for '%1' (parent:%2)", name, m_Parent));
98 #endif
99 }
100 #ifdef DIAG_DEVELOPER
101 else
102 ErrorEx(string.Format("'%1' is not registered light key", name));
103 #endif
104 }
105
106 bool LightExist(string name)
107 {
108 VehicleLightData data = m_LightMap.Get(name);
109 if (data && data.m_Light)
110 return true;
111
112 return false;
113 }
114
115 void AttachLightOnPoint(string name, string pointName, string targetPointName, int mode)
116 {
117 VehicleLightData data = m_LightMap.Get(name);
118 if (data && data.m_Light)
119 {
120 data.m_Light.AttachOnMemoryPoint(m_Parent, pointName, targetPointName);
121 if (mode == VehicleLightMode.SEGREGATED)
122 data.m_Light.SegregateLight();
123 else if (mode == VehicleLightMode.AGGREGATED)
124 data.m_Light.AggregateLight();
125 }
126 }
127
128 void AttachLightOnObject(string name, vector position, vector orientation, int mode, int boneIndex = -1)
129 {
130 VehicleLightData data = m_LightMap.Get(name);
131 if (data && data.m_Light)
132 {
133 data.m_Light.AttachOnObjectPivot(m_Parent, boneIndex, position, orientation);
134 if (mode == VehicleLightMode.SEGREGATED)
135 data.m_Light.SegregateLight();
136 else if (mode == VehicleLightMode.AGGREGATED)
137 data.m_Light.AggregateLight();
138 }
139 }
140
141 void DisableLight(string name)
142 {
143 VehicleLightData data = m_LightMap.Get(name);
144 if (data && data.m_Light)
145 {
146 data.m_Light.FadeOut();
147 data.m_Light = null;
148 }
149 }
150
151 void DestroyLight(string name)
152 {
153 VehicleLightData data = m_LightMap.Get(name);
154 if (data && data.m_Light)
155 {
156 data.m_Light.Destroy();
157 data.m_Light = null;
158 }
159 }
160
161 void SetLightTypeAndMode(string name, int lightType, int mode)
162 {
163 VehicleLightData data = m_LightMap.Get(name);
164 if (data && data.m_Light)
165 {
166 switch (lightType)
167 {
169 if (mode == VehicleLightMode.SEGREGATED)
170 data.m_Light.SegregateLight();
171 else if (mode == VehicleLightMode.AGGREGATED)
172 data.m_Light.AggregateLight();
173 break;
174
176 data.m_Light.SetAsSegregatedBrakeLight();
177 break;
178
180 data.m_Light.SetAsSegregatedReverseLight();
181 break;
182
184 data.m_Light.AggregateLight();
185 data.m_Light.SetFadeOutTime(1);
186 break;
187 }
188 }
189 }
190}
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
vector position
Определения DustKickupEffects.c:20
vector orientation
Определения DustKickupEffects.c:21
class Land_Buoy extends House m_Light
class VehicleLightType SEGREGATED
void VehicleLightData(VehicleLightProfileBase profile)
Определения VehicleLightsComponent.c:21
ref VehicleLightProfileBase m_LightProfile
Определения VehicleLightsComponent.c:19
string m_TargetPoint
Определения VehicleLightsComponent.c:16
const int AGGREGATED
Определения VehicleLightsComponent.c:38
class VehicleLightSelectionData m_Point
void SetLightProfile(notnull VehicleLightProfileBase profile)
Определения VehicleLightBase.c:21
Base class for vehicle light profiles - all changeble parameters goes here.
Определения VehicleLightProfileBase.c:3
void VehicleLightSelectionData(int id, string name)
Определения VehicleLightsComponent.c:6
const int NORMAL
Определения VehicleLightsComponent.c:29
const int REVERSE
Определения VehicleLightsComponent.c:31
const int REVERSE_BRAKE
Определения VehicleLightsComponent.c:32
const int BRAKE
Определения VehicleLightsComponent.c:30
bool LightExist(string name)
Определения VehicleLightsComponent.c:106
void EnableLight(string name)
Определения VehicleLightsComponent.c:83
void AttachLightOnObject(string name, vector position, vector orientation, int mode, int boneIndex=-1)
Определения VehicleLightsComponent.c:128
ref map< string, ref array< ref VehicleLightSelectionData > > m_SelectionMap
Определения VehicleLightsComponent.c:45
void DisableLight(string name)
Определения VehicleLightsComponent.c:141
void RegisterLight(string name, VehicleLightData data)
Определения VehicleLightsComponent.c:61
EntityAI m_Parent
Определения VehicleLightsComponent.c:43
ref map< string, ref VehicleLightData > m_LightMap
Определения VehicleLightsComponent.c:46
void AttachLightOnPoint(string name, string pointName, string targetPointName, int mode)
Определения VehicleLightsComponent.c:115
void SetSelectionMaterial(string name)
Определения VehicleLightsComponent.c:66
void RegisterSelection(string name, array< ref VehicleLightSelectionData > data)
Определения VehicleLightsComponent.c:56
void DestroyLight(string name)
Определения VehicleLightsComponent.c:151
void VehicleLightsComponent(notnull EntityAI parent)
Определения VehicleLightsComponent.c:48
void SetLightTypeAndMode(string name, int lightType, int mode)
Определения VehicleLightsComponent.c:161
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Определения Transport.c:70
Определения EnConvert.c:119
enum ShapeType ErrorEx
static const string Empty
Определения EnString.c:7