We are using the Dialogue System version 2.2.40.
Unity version 2021.3.23f1
Before I explain the issue, I have to say that I found a "solution" but it required me to edit the asset's code while investigating the problem, so I'm wondering if I'm doing something wrong.
Setup:
In our project, we have a scene called Main, which contains the DialogueManager, the Main Camera, the game's UI and other Managers.
Whenever we need to load a map, a manager inside the Main scene loads the scene additively, so usually there are 2 scenes open at the same time, for example, the Main scene and the Map_School scene.
Inside each Map scene, there's the DialogueSystemSceneEvents object that contains the events for that scene, it always stays there at the root of the Map scene, so when we exit the Map and change scenes, the object is destroyed along with the scene we just left.
The Issue:
When we exit a scene and later go back to that same scene, the scene events (yellow stars in the nodes) no longer work.
>Map_A has a dialogue with a event scene node, it works
https://prnt.sc/s_SbpCWSYdWV
>We exit the scene to Map_B
>We take a door from Map_B back to Map_A
>Scene event (yellow star) no longer works
What "fixed" the issue:
Like I said in the beginning, I did something that might have fixed the issue on our end but I can't help but wondering if I broke something.
I opened up the DialogueSystemSceneEvents.cs script and right after the Awake() function, I just added the lines:
Code: Select all
void OnDisable()
{
m_sceneInstances.Remove(this);
}
But it doesn't make sense why :/
I tried adding a Debug.Log to the Awake() function to check if the problem has something to do with not adding the object to list the second time (because the list is static), but with or without my modification it logs just normally, it adds the object again to the list, but the scene event calls only work with that OnDisable() function above.
Maybe the list ends up having 2 entries with the same ID?
Anyway, I wanted to bring this up to ask if I'm doing something wrong.
Thank you in advance.