public TrafficLightsSelectorController(Context context) { _context = context; _view = Object.Instantiate(_context.TrafficLightsSelectorViewPrefab, _context.MainCanvas); _view.Init(_context.AvailableTrafficLights, _context.OptionSelectedAction); }
public Context(TrafficLightsPoolConfig availableTrafficLights, Transform mainCanvas, TrafficLightsSelectorView trafficLightsSelectorViewPrefab, Action <string> optionSelectedAction) { AvailableTrafficLights = availableTrafficLights; MainCanvas = mainCanvas; TrafficLightsSelectorViewPrefab = trafficLightsSelectorViewPrefab; OptionSelectedAction = optionSelectedAction; }