public Context(TrafficLightsPoolConfig availableTrafficLights, Transform mainCanvas, TrafficLightsSelectorView trafficLightsSelectorViewPrefab, Action <string> optionSelectedAction) { AvailableTrafficLights = availableTrafficLights; MainCanvas = mainCanvas; TrafficLightsSelectorViewPrefab = trafficLightsSelectorViewPrefab; OptionSelectedAction = optionSelectedAction; }
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); } }