SceneLoadLocalDone of a single GlobalEventListener called twice (??)

Hello,
I have this GlobalEventListener whose SceneLoadLocalDone callback is called twice, and I don't understand why.

The method is this:

/* ... */
private bool once = true;

public override void SceneLoadLocalDone(string map)
{
if (once)
{
once = false;
BoltConsole.Write("SceneLoadLocalDone() called");

if (BoltNetwork.isServer)
{
Setup(0f);
}
}
}

Starting the server (and without any client connected) I see the message twice on the console. How is it possible (the check on the variable 'once' should prevent it)? And why does it run twice in the first place?

There is a single instance of the script attached to the 'BoltBehaviours' gameobject.
The annotation on it is [BoltGlobalBehaviour("Level1")], Level1 being the main scene the server loads at the startup.

Any help is appreciated!
matte.


Best Answer

Answers

  • Good to read you found it. At least it solved.