PixelCrushers.DialogueSystem.ConversationPopup resets its variable everytime I compile the code

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
fkkcloud
Posts: 298
Joined: Mon Oct 05, 2020 6:00 am

PixelCrushers.DialogueSystem.ConversationPopup resets its variable everytime I compile the code

Post 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
화면 캡처 2020-11-23 004613.png (54.05 KiB) Viewed 259 times
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: PixelCrushers.DialogueSystem.ConversationPopup resets its variable everytime I compile the code

Post 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?
fkkcloud
Posts: 298
Joined: Mon Oct 05, 2020 6:00 am

Re: PixelCrushers.DialogueSystem.ConversationPopup resets its variable everytime I compile the code

Post by fkkcloud »

I am instantiating DialogueManager prefab (not singleton) from GameManager(singleton) everytime I load a scene.
fkkcloud
Posts: 298
Joined: Mon Oct 05, 2020 6:00 am

Re: PixelCrushers.DialogueSystem.ConversationPopup resets its variable everytime I compile the code

Post by fkkcloud »

I just made DIalogueManager prefab part of GameManager Instance which is singleton. Solves the problem! :D

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)?
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: PixelCrushers.DialogueSystem.ConversationPopup resets its variable everytime I compile the code

Post by Tony Li »

That should be fine. I can't think of anything to watch out for.
Post Reply