Trouble using ConversationPopup Attribute

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
EffieArtoria
Posts: 9
Joined: Mon Mar 08, 2021 6:45 pm

Trouble using ConversationPopup Attribute

Post by EffieArtoria »

Hi. I'm having a little trouble. I have this field in my custom class:

Code: Select all

        [ConversationPopup(false, true)]
        public string conversation = string.Empty;
When I look at it in editor, if I've already looked at an object with a Dialogue System Trigger, then it behaves as expected, I get a little dropdown menu that lets me pick the conversation I want. However, if I'm looking at my game object with my custom script after Unity has reloaded script assemblies, it will look like an ordinary string field (with the filter, and an unchecked radio button). I can look at the Trigger again to get it to work, but I don't know what exactly is going wrong. Is there something I need to initialise inside of my object?

Thank you for your time
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Trouble using ConversationPopup Attribute

Post by Tony Li »

Try [ConversationPopup(true)]. This will provide a dialogue database field that you can assign to populate the dropdown. The [ConversationPopup] attribute is just an editor convenience. It doesn't store any data with your component, such as which database you've assigned, so in certain cases you may need to assign the database again: if the open scene doesn't have a Dialogue Manager, or if you've most recently used a conversation popup field with a different database.
Post Reply