Unity crashing when trying to use MMO as base


I've hit a problem which I'm really struggling to overcome. I've narrowed down where the problem is starting, but a bit baffled as to why it's happening.

In the MMO demo project, the UnityGrid game holds references to a Photon.MmoDemo.Client.Unity3D dll, and uses that DLL to instantiate certain classes such as Game.

In my project, I'm trying to build upon the MmoDemo project, so I've created my own game, which references a DLL I've created which holds all the same classes as the Photon.MmoDemo.Client.Unity3D DLL. The two projects (the actual game scripts, and the client DLL) both reside in the same visual studio solution, and works quite nicely as I'm able to debug both whilst running the game. So far, I've just mimicked the MmoDemo project.

However, unlike the MmoDemo, which runs fine, my game on the other hand crashes! I suspect maybe it's something to do with passing objects in method calls between the DLL and the actual game, but I'm not sure.

So this is where the error is occurring, once it calls OnItemAdded and enters that method, Unity comes up with a "stopped responding" windows message. If I were to run the code and break before the method call (like in the image), Unity and Visual Studio crash just by highlighting over the this.listener object and trying to inspect it's properties! The listener is in the actual game code, and passed into the DLL. The AddItem method in the image is a method within the game class of the DLL, and is using the listener it was passed to call a method back in the game - I suspect either the listener isn't being passed in correctly (explains why it crashes when inspecting), or calls between the game to the DLL and then back to the game is doing something weird. But why wouldn't it cause this before in the original demo!?

Thanks for any assistance you can provide.


  • vadimvadim ✭✭✭

    Do you have any traces of crash like logs or stack?
    Can you debug Unty editor from Visual Studio? Set breakpoint in OnItemAdded and start application in Editor.
    Maybe you somehow call AddItem recursively? This can crash Unity in theory,
Sign In or Register to comment.