DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ UpdateLightsClient()

void UpdateLightsClient ( int newGear = -1)
protected

См. определение в файле MotorbikeScript.c строка 1088

1089 {
1090 int gear;
1091
1092 if (newGear == -1)
1093 gear = GetGear();
1094 else
1095 gear = newGear;
1096
1097 if (LightIsOn())
1098 {
1099 if (!m_LightsComponent.LightExist("Front") && m_HeadlightsState != MotorbikeHeadlightState.NONE)
1100 m_LightsComponent.EnableLight("Front");
1101
1102 if (m_LightsComponent.LightExist("Front"))
1103 {
1104 switch (m_HeadlightsState)
1105 {
1106 case MotorbikeHeadlightState.MAIN:
1107 int driveWheelIndex = GetBoneIndex("drivewheel");
1108 //m_LightsComponent.AttachLightOnPoint("Front", m_HeadLightPoint, m_HeadLightTargetPoint, VehicleLightMode.SEGREGATED);
1109 m_LightsComponent.AttachLightOnObject("Front", GetMemoryPointPos(m_HeadLightPoint), vector.Zero, VehicleLightMode.SEGREGATED, driveWheelIndex);
1110 break;
1111
1112 default:
1113 m_LightsComponent.DisableLight("Front");
1114 }
1115 }
1116 }
1117 else
1118 {
1119 if (m_LightsComponent.LightExist("Front"))
1120 m_LightsComponent.DisableLight("Front");
1121 }
1122
1123 // brakes & reverse
1124 switch (gear)
1125 {
1127 m_RearLightType = MotorbikeRearLightType.BRAKES_ONLY;
1128 else
1129 m_RearLightType = MotorbikeRearLightType.NONE;
1130 }
1131
1132 //Debug.Log(string.Format("m_BrakesArePressed=%1, m_RearLightType=%2", m_BrakesArePressed.ToString(), EnumTools.EnumToString(MotorbikeRearLightType, m_RearLightType)));
1133
1134 if (!m_LightsComponent.LightExist("Rear") && m_RearLightType != MotorbikeRearLightType.NONE && m_HeadlightsState != MotorbikeHeadlightState.NONE)
1135 {
1136 if (EngineIsOn() || m_RearLightType == MotorbikeRearLightType.BRAKES_ONLY)
1137 {
1138 m_LightsComponent.EnableLight("Rear");
1139 if (MemoryPointExists(m_RearLightPoint))
1140 m_LightsComponent.AttachLightOnObject("Rear", GetMemoryPointPos(m_RearLightPoint), "180 0 0", VehicleLightMode.SEGREGATED);
1141 #ifdef DIAG_DEVELOPER
1142 else
1143 ErrorEx(string.Format("Missing '%1' memory point, check memory LOD", m_RearLightPoint), ErrorExSeverity.INFO);
1144 #endif
1145 }
1146 }
1147
1148 // rear lights
1149 if (m_LightsComponent.LightExist("Rear") && m_RearLightType != MotorbikeRearLightType.NONE && m_HeadlightsState != MotorbikeHeadlightState.NONE)
1150 {
1151 switch (m_RearLightType)
1152 {
1153 case MotorbikeRearLightType.BRAKES_ONLY:
1154 m_LightsComponent.SetLightTypeAndMode("Rear", VehicleLightType.BRAKE, VehicleLightMode.SEGREGATED);
1155 break;
1156
1157 default:
1158 m_LightsComponent.DisableLight("Rear");
1159 }
1160 }
1161 else
1162 {
1163 if (m_LightsComponent.LightExist("Rear"))
1164 m_LightsComponent.DisableLight("Rear");
1165 }
1166 }
proto native bool EngineIsOn()
Returns true when engine is running, false otherwise.
proto native int GetGear()
Returns the index of the future gear, -1 if there is no engine.
static string m_HeadLightPoint
Определения MotorbikeScript.c:69
bool m_BrakesArePressed
Определения MotorbikeScript.c:60
MotorbikeHeadlightState
Определения MotorbikeScript.c:2
static string m_RearLightPoint
Определения MotorbikeScript.c:71
ref VehicleLightsComponent m_LightsComponent
Определения MotorbikeScript.c:74
const int BRAKE
Определения VehicleLightsComponent.c:30
static const vector Zero
Определения EnConvert.c:123
Определения EnConvert.c:119
ErrorExSeverity
Определения EnDebug.c:62
enum ShapeType ErrorEx

Перекрестные ссылки VehicleLightType::BRAKE, EngineIsOn(), ErrorEx, GetGear(), m_BrakesArePressed, m_HeadLightPoint, m_LightsComponent, m_RearLightPoint и vector::Zero.

Используется в Car::UpdateLights() и UpdateLights().