Skip to content

Embedding Unity Build into Uno Platform (Windows and Wasm) #12313

Discussion options

You must be logged in to vote

Don't know what the likelihood of someone else trying this is, but here's how I got it working in any case.

WinUI Impementation

The functionality is split into across two classes, the first is a UserControl that is in charge of actually instantiating the Unity process as its content, and the second is a helper/utils class that just has references to all the relevant Win32 methods.

There are definitely some improvements that can be made here, but I'd say it's a good start.

using System.Diagnostics;
using System.Reflection;
using Windows.Foundation;
using WinRT.Interop;

public sealed partial class WinUI_UnityWindow : UserControl
{
    #region Win32 Settings
    private const int SWP_NOACTI…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@BertrandDeSaintBezier
Comment options

@jeromelaban
Comment options

Comment options

You must be logged in to vote
3 replies
@JeBuSBrian
Comment options

@BertrandDeSaintBezier
Comment options

@chuckthompsonprofisee
Comment options

Answer selected by BertrandDeSaintBezier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants