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