Closed fversnel closed 8 years ago
How about creating a new project called Lidgren.Unity project in the same solution and put all Unity related code in there? Since this is only one file it doesn't really matter but if we get more Unity specific code this might be a better approach than to add all files directly to the main Lidgren project.
Hi! Thanks for the code; I changed it slightly since the NetBuffer is already a partial class, it makes sense to just incorporate them there. Let's add a special project when we get enough files to warrant it.
Cool! Thanks for accepting :)
Thanks again for the code... I don't use Unity so it's all untested (even uncompiled!) from my side; please sync and verify I didn't leave any compile errors in there...
For everyone who uses Lidgren with Unity this might be useful. You can now simply write your Vector3, Quaternion etc. directly to the Lidgren Netbuffer by calling (for example):
NetBuffer.Write(new Vector3(1.0f, 1.0f, 1.0f));