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. Dismiss Notice

Integrate unity in c++ program

Discussion in 'Editor & General Support' started by garodev, Dec 10, 2014.

  1. garodev

    garodev

    Joined:
    Dec 10, 2014
    Posts:
    2
    Hi!
    I´m new and i don´t know if this is the site of my question.
    I´m working in a project and i need to integrate a unity project in mi C++ program (with Visual) i want to know if it´s possible.
    Thanks to everybody :)
     
  2. chechoggomez

    chechoggomez

    Unity Technologies

    Joined:
    Feb 25, 2013
    Posts:
    91
    In Unity 4.5.5p1 was added support for embedding the windows standalone player into another application

    http://unity3d.com/unity/qa/patch-releases?page=2
    • Windows Standalone: You can now embed windows standalone player into another application, simply pass -parentHWND and windows standalone application's window will be created with specified parent. See Command line arguments documentation for more information.

    http://docs.unity3d.com/Manual/CommandLineArguments.html

    -parentHWND <HWND> (Windows only) Embeds Windows Standalone application into another application, you have to pass parent application’s window handle to Windows Standalone application. See this example EmbeddedWindow.zip for more information.
     
  3. aiab_animech

    aiab_animech

    Joined:
    Jul 4, 2012
    Posts:
    177
    Any best practices for communication between the parent and the child application?
    Can think of a number of cumbersome ways, but does anyone have a good suggestion for an easy way (that maybe doesn't require a native plugin)?
     
  4. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,169
    I suppose you could cobble something together with WCF, but probably easiest to just open a socket and communicate back and forth.
     
  5. aiab_animech

    aiab_animech

    Joined:
    Jul 4, 2012
    Posts:
    177
    Yep, I guess. Thanks!
     
  6. garodev

    garodev

    Joined:
    Dec 10, 2014
    Posts:
    2
    Thanks!
    I think this might be useful for me :)