Hi,
The Files type probably isn't what you're looking for. It just holds a text string. (Chat Mapper uses the Files type to manage file lists, but the Dialogue System doesn't.)
Instead, you can add a custom field that uses the Number or Text type. If you use a Number, you can reference the icon by its index number in your component's list. If you use a Text field, you can reference the icon by its name. Or you can create a
custom field type. Custom field types are typically used to provide a custom dropdown selection menu.
In your custom input panel, look up the field in the current dialogue entry, which you can access via DialogueManager.currentConversationState.subtitle.dialogueEntry. For example, say it's a Text field named "Icon" that contains the name of a sprite in a Resources folder (to make the example simple). The relevant code might look something like this:
Code: Select all
public override void Open() // Overrides StandardUIInputField.Open.
{
base.Open();
var entry = DialogueManager.currentConversationState.subtitle.dialogueEntry;
var iconName = Field.LookupValue(entry, "Icon");
myImage.sprite = Resources.Load<Sprite>(iconName);
}