The issue of porting Unity to UWP and adding in-app purchases.

一 王 0 Reputation points
2025-01-02T15:44:42.7+00:00

I have a Unity game and I want to port it to UWP and add Microsoft in-app purchases. Are there any tutorials or case studies available? I have failed multiple times, especially when trying to add DLLs and other components.

thanks

Universal Windows Platform (UWP)
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Taylor 56,446 Reputation points
    2025-01-02T16:18:57.9733333+00:00

    UWP is a different beast than a regular NET app so you cannot simply "migrate" from your codebase to UWP. Copying DLLs will probably result in errors about them not supporting the runtime. You must use assemblies/packages that support UWP.

    I would recommend you follow the instructions given here for creating a new Unity UWP app. Then bring across your Unity-specific code piece by piece and adding the UWP-compatible packages to get it to compile. You'll undoubtedly need to make code changes because the runtime model of UWP is different than what you're using now but hopefully the changes won't be too bad. Again, do this piecemeal until everything is converted so you can fix compiler errors as you go along.

    Further support for Unity should be posted in their support channel.

    0 comments No comments

  2. Roy Li - MSFT 33,591 Reputation points Microsoft Vendor
    2025-01-17T02:21:10.27+00:00

    Hello,

    Welcome to Microsoft Q&A!

    Unity project should be able to build as a UWP project. For more information, you might need to check the Unity document.

    I want to share some information about the in-app purchase from the UWP side.

    To implement in-app purchase, you could use Windows.Services.Store API which provides types and members you can use to access and manage Microsoft Store-related data for the current app. You could enable in-app purchase for different types of add-ons you created using API from Windows.Services.Store namespace.

    More information, please refer to this document: In-app purchases and trials

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.