![]() Additional calls to StartCoroutine inside a coroutine have to be defined as being a child coroutine. Coroutines require that you specify if they are a 'root coroutine', for an initial call to StartCoroutine.Similarly, Component will call Awake, Start, Update, and LateUpdate (as well as a few others) components derive from Component, not from Monobehaviour.You'll need to make RoomBehaviours and attach them to the room as rooms are not necessarily scenes, they additionally have no default behaviour to them.Instead, you should define when a client should switch scenes, if it makes sense. rooms are not necessarily scenes in unity.Gameobjects have a room variable that will return which room they are a part of. the server never exists in one 'scene', and instead runs them all at the same time as rooms.Use room.NetworkInstantiate, which correctly sets up a networked gameobjects. gameobjects should not be spawned by themselves if you want to network them.Networking also works similarly to unity's networking, with methods on components being marked with an RpcAttribute. The server works similarly to Unity, where gameobjects have components attached to them. ![]() ![]() When writing for Unity, reference the PNetU namespace, as it is Unity glue code to PnetC. PNet, PNetS, SlimMath, and Lidgren.Network should be referenced in the server. The PNet.dll, PNetC.dll, PNetU.dll, and should be copied to a Plugins folder in unity. Instructions are included in an additional text file. You will need to check out both of these repos, as well as patch Lidgren. An SVN patch file is included, as well as svn repo addresses. This library uses Lidgren(client/server) and SlimMath(server), with some patches to Lidgren to work with Unity. Networking middleware for Unity using Lidgren, with a custom dedicated server.
0 Comments
Leave a Reply. |