private void Start() { _animator = gameObject.GetComponent <Animator>(); HashSet <MapGenerator.CategoryType> allSavedCategoryTypes = MapGenerator.getAllSavedCategoryTypes(); for (int i = 0; i < MapGenerator.DEFAULT_CATEGORY_TYPES.Count; i++) { MapGenerator.CategoryType categoryType = MapGenerator.DEFAULT_CATEGORY_TYPES[i]; OptionEntryController entryController = GameObject.Instantiate(_entryPrefab, _entryRoot); entryController.Initialize(categoryType, allSavedCategoryTypes.Contains(categoryType)); } }
public void Initialize(MapGenerator.CategoryType categoryType, bool defaultValue) { _categoryType = categoryType; _displayNameLabel.text = categoryType.ToString(); _toggleButton.isOn = defaultValue; }