Using photon with Uframe

Hi, i have a problem when using scenes in uframe with photon.
Uframe is using LoadLevelAdditive and destroys all transforms when switching scenes, and it work ok when starting on menu scene and going to the game scene.
But the problem is when i go from the gameScene to the menuScene, the menuScene uses the same setup as in the worker demo example in photon, and the game scene only has a gameobject with a PhotonView on it.

So if i go from gameScene to menuScene the menu only show Connecting but there are no errors or nothing.
Is there something i should clean up before going from gamescene to menu scene or?
If i remove the photonView from game scene and go from gamescene to menuscene it will connect normally as if i start the menu scene directly.

Comments

  • I am in contact with another developer who is working with uFrame. Let me copy and paste some hints from that conversation:

    Tobias wrote:
    I don't really know what Uframe does or doesn't in the background.
    The problem might have to do with it destroying the GOs instead of letting Unity do it.

    I would like to know if the hidden PhotonHandler object stays in the scene or not. Maybe it gets destroyed and then no script is left to update PUN.
    In PhotonNetwork find "photonGO.hideFlags = HideFlags.HideInHierarchy" and comment that out. Run in editor and check if the (formerly) hidden GameObject is still around when you leave the game.

    You could also add "void OnDestroy()" and log something in the PhotonHandler to see if and from where it's being cleaned up.

    I think that helps with your problem. Aside from that:
    Tobias wrote:
    I think it makes sense to avoid the automatic level loading of PUN.
    JoinRoom is not related to the scenes at all. PUN has a simple feature to sync scenes of all clients to that loaded in the MasterClient. However, that does not apply here, I'd say.

    There is a property PhotonNetworking.automaticallySyncScene. Set it to false and don't use PhotonNetwork.LoadLevel at all and you should be free to sync the loaded level yourself.
    You can use Room.SetCustomProperties to set a property of the level(s) the clients should load. Check this property to load levels on joining clients and in the callback OnPhotonCustomRoomPropertiesChanged (described in PhotonNetworkingMessage).