private TrafficLightOptionView CreateOption(TrafficLightsConfigViewPair trafficLightConfigViewPair, Action <string> onOptionSelectedAction) { TrafficLightOptionView newOption = Instantiate(trafficLightOptionPrefab, optionsRootTransform); newOption.SetOption(trafficLightConfigViewPair.Config.Caption, onOptionSelectedAction); return(newOption); }
public void Init(TrafficLightsPoolConfig trafficLightsPool, Action <string> onOptionSelectedAction) { _trafficLightsOptions = new List <TrafficLightOptionView>(); foreach (TrafficLightsConfigViewPair trafficLightConfigViewPair in trafficLightsPool.AvailableTrafficLights) { TrafficLightOptionView newOption = CreateOption(trafficLightConfigViewPair, onOptionSelectedAction); _trafficLightsOptions.Add(newOption); } }