Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

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:
    9,885
    Call into UnityPlayer.dll from a new thread, as Unity will take over that thread.
     
    appels likes this.