protected virtual void OnEncounterSelected(object sender, EncounterSelectedEventArgs e) { Characters = e.Encounter.Content.NonImageContent.Characters; Dropdown.ClearOptions(); CharacterKeys = new string[Characters.Count]; var options = new List <TMP_Dropdown.OptionData>(); for (int i = 0; i < Characters.Count; i++) { var character = Characters[i]; CharacterKeys[i] = character.Key; var sprite = IconSpriteRetriever.GetIconSprite(e.Encounter, character.Value.Icon); options.Add(new TMP_Dropdown.OptionData(character.Value.Role, sprite)); } Dropdown.AddOptions(options); if (InitialValue != null) { SetValue(InitialValue); } }
protected virtual void OnEncounterSelected(object sender, EncounterSelectedEventArgs e) { Button.interactable = true; Button.onClick.RemoveAllListeners(); Button.onClick.AddListener(EditCharacters); }