public void SetLightColor(TrafficLightSetState state, Material mat) { currentState = state; if (currentState == TrafficLightSetState.Red) { event_state = 3; } else if (currentState == TrafficLightSetState.Yellow) { event_state = 5; } else if (currentState == TrafficLightSetState.Green) { event_state = 7; } if (stopline != null) { stopline.currentState = state; } foreach (var item in lightRenderers) { item.material = mat; } }
public void SetLightColor(TrafficLightSetState state, Material mat) { currentState = state; if (stopline != null) { stopline.currentState = state; } foreach (var item in lightRenderers) { item.material = mat; } }