Example #1
0
        private TrafficLightOptionView CreateOption(TrafficLightsConfigViewPair trafficLightConfigViewPair, Action <string> onOptionSelectedAction)
        {
            TrafficLightOptionView newOption = Instantiate(trafficLightOptionPrefab, optionsRootTransform);

            newOption.SetOption(trafficLightConfigViewPair.Config.Caption, onOptionSelectedAction);

            return(newOption);
        }
Example #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);
            }
        }