Search code examples
c#socketsunity-game-enginewindows-store-appswindows-store

Using Windows.Networking.Sockets in Unity3D


I am trying to port our Unity application for Windows Store and so far I cannot get the SDK to work. I've gotten up to the point where I can open Unity C# project in Visual Studio 2013 Express for Windows Desktop (which is odd because "... for Windows" cannot open Unity project, yet is needed for the development). The macros #if UNITY_WINRT started to work, but I cannot seem to get the "using" part right

using UnityEngine;
using System.Collections;
#if UNITY_WINRT
using Windows.Networking.Sockets;
#else
using System.Net;
using System.Net.Sockets;
#endif
using System;
using System.Threading;
using System.Xml;
using System.Collections.Generic;

and the Windows.Networking.Sockets is underlined as wrong, generally, the using Windows doesn't seem to be present ... what am I doing wrong? Should I add something to the using part? Should I add some library?

Now I get why Windows Phone has so few app developers if the development setup is so hard and restricted compared to Android or iOS (well this is restricted, but setup is easy).

Thank you very much for your help ...


Solution

  • Well I got it up and running. I created a DLL library in C# (managed) in Visual Studio. Then I called the methods I needed from within mu Unity application.