1975 {
1976 int gear;
1977
1978 if (newGear == -1)
1979 {
1982 {
1984 }
1985 }
1986 else
1987 {
1988 gear = newGear;
1989 }
1990
1991 if (LightIsOn())
1992 {
1994
1995 switch (m_HeadlightsState)
1996 {
1997 case CarHeadlightBulbsState.LEFT:
2001 break;
2002 case CarHeadlightBulbsState.RIGHT:
2006 break;
2007 case CarHeadlightBulbsState.BOTH:
2011 break;
2012 default:
2015 }
2016
2017
2018 }
2019 else
2020 {
2025 }
2026
2027
2028
2029 switch (gear)
2030 {
2031 case CarGear.REVERSE:
2034 m_RearLightType = CarRearLightType.BRAKES_AND_REVERSE;
2035 else
2036 m_RearLightType = CarRearLightType.REVERSE_ONLY;
2037 break;
2038 default:
2040 m_RearLightType = CarRearLightType.BRAKES_ONLY;
2041 else
2042 m_RearLightType = CarRearLightType.NONE;
2043 }
2044
2045
2046
2047
2048
2049 if (m_RearLightType != CarRearLightType.NONE && m_HeadlightsState != CarHeadlightBulbsState.NONE)
2050 {
2051 switch (m_RearLightType)
2052 {
2053 case CarRearLightType.BRAKES_ONLY:
2056 break;
2057 case CarRearLightType.REVERSE_ONLY:
2059 {
2063 }
2064 else
2065 {
2068 }
2069 break;
2070 case CarRearLightType.BRAKES_AND_REVERSE:
2072 {
2075 }
2076 else
2077 {
2080 }
2081 break;
2082 default:
2084
2087 }
2088 }
2089 else
2090 {
2092
2095 }
2096 }
CarAutomaticGearboxMode
Enumerated automatic gearbox modes. (native, do not change or extend)
CarGearboxType
Enumerated gearbox types. (native, do not change or extend)
proto native CarGearboxType GearboxGetType()
Returns gearbox type. See CarGearboxType enum for more info.
proto native CarAutomaticGearboxMode GearboxGetMode()
Returns gearbox mode. This is useful when motorbike has automatic gearbox.
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.
ref VehicleLightsComponent m_LightsComponent
bool HasGangedTailAndBrakeLights()