Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Windows 10 + UWP + Live!

Discussion in 'Windows' started by dsmethurst_t17, Oct 7, 2015.

  1. dsmethurst_t17

    dsmethurst_t17

    Joined:
    Feb 25, 2014
    Posts:
    7
    We're currently in the middle of developing a game for Windows 10 and are looking for information on how to integrate with the Live! platform from Unity 5.2.1p2.

    Has anyone gone about this already - can you offer any guides on how this can be done?

    Thanks,
    David.
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,644
  3. dsmethurst_t17

    dsmethurst_t17

    Joined:
    Feb 25, 2014
    Posts:
    7
    Hi Tautvydas,

    Thanks for the information, our company is already part of the id@xbox program, is this a download that needs approval from Unity or Microsoft?

    Thanks,
    David
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,644
    If you're part of id@xbox, you should already have access. If you can't find it, email your contact at id@xbox, he will get it for you. The Live SDK for UWP that I'm referring to doesn't have anything to do with Unity: it's purely Microsoft SDK.

    If you developed for xbox using Unity, you'll know that we have special Unity plugins for it that wrap the Microsoft SDK and that is made by us. We have plans to make similar plugins for UWP, but they're not ready yet (and will not be for at least a couple of months). In result, you will need to use Microsoft xbox live SDK directly if you need it today. As far as I know, the SDK comes with winmd files, so it's possible to use it from C#.
     
  5. dsmethurst_t17

    dsmethurst_t17

    Joined:
    Feb 25, 2014
    Posts:
    7
    Thanks for the reply and help, we will investigate the winmd option.

    Thanks,
    David
     
  6. Danguru

    Danguru

    Joined:
    Jan 14, 2011
    Posts:
    27
    I tried to use the lib , but i solved with another dll that i made , how can i use the winmd directly in unity?
    Do you know when will be ready this plug in?
     
  7. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,644
    We don't have an ETA for the plugin.

    As for using winmd directly: in Unity 5.3, just drop winmd and DLLs into the project, mark it as compatible with Windows Store only, and then just use it in your scripts that are wrapped in "#if NETFX_CORE"/"#endif".
     
  8. nukeustwo

    nukeustwo

    Joined:
    Sep 4, 2015
    Posts:
    51
    Hi Guys,

    I've been looking at trying to wrap some of the live SDK in a dll for the same purposes, but I'm struggling to find the right approach.

    Specifically the documentation requires references to two of the xbox live cpp targets:
    • {SDK source root}Casablanca\Release\src\build\vs14.uwp\cpprestsdk140.uwp.static.vcxproj
    • {SDK source root}\Build\Microsoft.Xbox.Services.140.UWP.Cpp\Microsoft.Xbox.Services.140.UWP.Cpp.vcxproj
    My first approach, attempting to build a Windows Universal DLL project, when I add the references from my project to these two sources they reference fine, and I can build my DLL, however attempting to load the DLL in Unity fails with:

    Failed to load 'dll' with error 'This operation is only valid in the context of an app container

    From this thread : http://forum.unity3d.com/threads/using-winrt-apis-from-a-desktop-windows-app.331711/ it's clear that this is because the DLL contains the same flags which expect it to be run as a store app only. The next step was to try a win32 dll rather than a universal one.

    However, with a win32 DLL project, the two vcxproj's that are required as references for the xbox live service code cannot be referenced from this project, specifically they error with:

    A reference to 'Microsoft.Xbox.Services.140.UWP.cpp' cannot be added because the two projects target different platforms.

    This is the point I'm currently at, I'm not certain what the visual studio error is referring to by 'different platforms'. If I inspect the project settings for my win32 DLL then my target platform is 'Windows 10' and the platform version matches the vcxproj's target and version number. Both have the same visual studio targets.

    @Danguru did you run into this issue / find a workaround for creating a dll that unity can then load? @Tautvydas Zilys do you have any suggestions of where to look? Thanks in advance.
     
  9. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,644
    As far as I know, and I can tell from name, both cpprestsdk140.uwp.static.vcxproj and Microsoft.Xbox.Services.140.UWP.Cpp.vcxproj are targeting Windows Store. I suppose visual studio is not happy because you're trying to reference them from a project that's targeting Windows Desktop, rather than Windows Store.