コード例 #1
0
        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);
            }
        }
コード例 #2
0
 protected virtual void OnEncounterSelected(object sender, EncounterSelectedEventArgs e)
 {
     Button.interactable = true;
     Button.onClick.RemoveAllListeners();
     Button.onClick.AddListener(EditCharacters);
 }