Page 1 of 1
PixelCrushers.DialogueSystem.ConversationPopup resets its variable everytime I compile the code
Posted: Mon Nov 23, 2020 3:48 am
by fkkcloud
Hello
PixelCrushers.DialogueSystem.ConversationPopup resets its variable every time I compile the code in the inspector.
Code: Select all
[PixelCrushers.DialogueSystem.ConversationPopup(true)]
Is there any way to prevent this?
Right now, everytime I change the code, it resets the database reference to null so I have to re-find/select it to make that conversation dropdown menu to be valid/working
- 화면 캡처 2020-11-23 004613.png (54.05 KiB) Viewed 263 times
Re: PixelCrushers.DialogueSystem.ConversationPopup resets its variable everytime I compile the code
Posted: Mon Nov 23, 2020 9:53 am
by Tony Li
Hi,
[ConversationPopup] doesn't record your database assignment. Otherwise every place you use [ConversationPopup] would add extra data to your component that's not needed at runtime.
Instead, [ConversationPopup] looks for a Dialogue Manager in your scene. If it finds one, it uses the database assigned to the Dialogue Manager's Initial Database field.
Does your scene have a Dialogue Manager with a database assigned to it?
Re: PixelCrushers.DialogueSystem.ConversationPopup resets its variable everytime I compile the code
Posted: Mon Nov 23, 2020 6:57 pm
by fkkcloud
I am instantiating DialogueManager prefab (not singleton) from GameManager(singleton) everytime I load a scene.
Re: PixelCrushers.DialogueSystem.ConversationPopup resets its variable everytime I compile the code
Posted: Mon Nov 23, 2020 7:08 pm
by fkkcloud
I just made DIalogueManager prefab part of GameManager Instance which is singleton. Solves the problem!
What are the consequences (usual thing to watch out) if I make the DialogueManager (kind of) a singelton as it being a part of GameManager(singleton)?
Re: PixelCrushers.DialogueSystem.ConversationPopup resets its variable everytime I compile the code
Posted: Mon Nov 23, 2020 8:15 pm
by Tony Li
That should be fine. I can't think of anything to watch out for.