public override void Apply(NetworkSkin skin) { skin.m_nodeMarkingsHidden = nodeMarkingsHidden; if (skin.m_lanes != null) { for (var l = 0; l < skin.m_lanes.Length; l++) { var laneProps = skin.m_lanes[l]?.m_laneProps?.m_props; if (laneProps == null) { continue; } for (var p = skin.m_lanes[l].m_laneProps.m_props.Length - 1; p >= 0; p--) { if (arrowsHidden && RoadDecorationUtils.IsArrow(laneProps[p]?.m_finalProp) || signsHidden && RoadDecorationUtils.IsSign(laneProps[p]?.m_finalProp) || decorationHidden && RoadDecorationUtils.IsDecoration(laneProps[p]?.m_finalProp) || transportStopsHidden && RoadDecorationUtils.IsTransportStop(laneProps[p]) || (trafficLightsHidden && RoadDecorationUtils.IsTrafficLight(laneProps[p])) || levelCrossingsHidden && RoadDecorationUtils.IsLevelCrossing(laneProps[p])) { skin.RemoveLaneProp(l, p); } } } } }
private void Refresh() { CanHideNodeMarkings = CanHideMarkings(Prefab); var variations = NetUtils.GetPrefabVariations(Prefab); HasArrows = variations.Any(prefab => NetUtils.GetMatchingLaneProp(prefab, laneProp => RoadDecorationUtils.IsArrow(laneProp.m_finalProp)) != null); HasSigns = variations.Any(prefab => NetUtils.GetMatchingLaneProp(prefab, laneProp => RoadDecorationUtils.IsSign(laneProp.m_finalProp)) != null); HasDecoration = variations.Any(prefab => NetUtils.GetMatchingLaneProp(prefab, laneProp => RoadDecorationUtils.IsDecoration(laneProp.m_finalProp)) != null); HasTransportStops = variations.Any(prefab => NetUtils.GetMatchingLaneProp(prefab, laneProp => RoadDecorationUtils.IsTransportStop(laneProp)) != null); HasTrafficLights = variations.Any(prefab => NetUtils.GetMatchingLaneProp(prefab, laneProp => RoadDecorationUtils.IsTrafficLight(laneProp)) != null); HasLevelCrossings = variations.Any(prefab => NetUtils.GetMatchingLaneProp(prefab, laneProp => RoadDecorationUtils.IsLevelCrossing(laneProp)) != null); }