Search Unity

Embedding UnityPlayer into a Forms application

Discussion in 'Editor & General Support' started by appels, Nov 29, 2021.

  1. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,687
    Hi,

    I can embed the UnityPlayer when I Start the player as a sepperate process using the CmdLine argument -parentHWND and the handle of my splitcontainer in my Windows Forms application.
    But then you have a sepperate process.
    I tried the other method by importing the Dll described here: https://docs.unity3d.com/Manual/UnityasaLibrary-Windows.html
    and here: https://forum.unity.com/threads/uni...ly-from-your-own-standalone-launcher.1026745/
    But then the game starts and the form is not showing anymore.
    Is it possible to embed into the same process and have the player show up on the form ?
    Any examples of that around ?
    Thanks
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Call into UnityPlayer.dll from a new thread, as Unity will take over that thread.
     
    appels likes this.