Skip to content
Andrés edited this page Dec 10, 2015 · 1 revision

Steps to use this library with Unity

  1. Define the constants __CONSTRAINED__ and UNITY in the project.
  2. Add the Unity Reference to the solution located at Unity/Editor/Data/Managed/UnityEngine.dll
  3. Change the target framework to "Unity 3.5 .net Subset Base Class Libraries"
  4. Build the solution to generate the dlls. You will find them inside "Lidgren.Network/bin/Debug" or "Lidgren.Network/bin/Release"
  5. Copy the files inside /bin/Release or /bin/Debug (Lidgren.Network.dll, Lidgren.Network.XML, Lidgren.Network.pdb) to the folder Assets/Assemblies/Lidgren of your Unity Project. Create the folders if they don't exist. Also put a copy of the LICENSE file in that folder. Looking inside the Project window in unity must show the folder Assemblies.

Using Visual Studio

  1. On the window Solution Explorer window right click on Lidgren.Network > Properties, Build, and type on "Conditional compilation symbols": UNITY __CONSTRAINED__

  2. On the window Solution Explorer window expand Lidgren.Network, right click on References > Add Reference..., Click Browse..., go to Unity/Editor/Data/Managed/UnityEngine.dll and click on Add

  3. On the window Solution Explorer window right click on Lidgren.Network > Properties, Application, and change "Target framework"

  4. Select "Debug" or "Release" on the drop down menu near the Start button, then on the Solution Explorer window right click on Lidgren.Network > Build

Using Xamarin

  1. On the Solution window right click on Lidgren.Network > Options, Build, Compiler, and type on "Define Symbols": UNITY __CONSTRAINED__

  2. On the window Solution window expand Lidgren.Network, right click on References > Edit References... > .Net Assembly, Click Browse..., go to Unity/Editor/Data/Managed/UnityEngine.dll and click on Open

  3. On the Solution window right click on Lidgre.Network > Options, Build, General, and change "Target framework"

  4. Select "Debug" or "Release" on the drop down menu near the Play button, then on the Solution window right click on Lidgren.Network > Build

Clone this wiki locally