Unity version 4.3.3f1
Long story short: I have two connected players playing a game.
Then I try to load like this:
The call is done by an RPC, and all the code executes perfectly up to this point:
networkView.RPC(“WinScreenGo”, RPCMode.All);
//
//
[RPC]
void WinScreenGo()
{
Debug.Log("RPC Received");
NetworkLevelLoader.Instance.Loadlevel("WinScreen");
}
public void Loadlevel(string levelName, int prefix = 0)
{
StopAllCoroutines();
if (prefix == 0)
{
levelLoadPrefix++;
prefix = levelLoadPrefix;
}
StartCoroutine(doLoadLevel(levelName, prefix));
}
IEnumerator doLoadLevel(string name, int prefix)
{
Network.SetSendingEnabled(0, false);
Network.isMessageQueueRunning = false;
Network.SetLevelPrefix(prefix);
Application.LoadLevel(name);
yield return null;
yield return null;
Network.isMessageQueueRunning = true;
Network.SetSendingEnabled(0, true);
}
It just straight up crashes. I tried to change the level that gets loaded, etc.
When I test with a debug log, I see that the
" networkView.RPC(“WinScreenGo”, RPCMode.All);"
gets loaded, but the next debug log doesn’t even make it to the debugger before client and server freeze.
I’ve been stuck on this for weeks. Thoughts please?