Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How get the Unity3D View In wpf winform

Tags:

c#

wpf

unity3d

Hi, I'm working in Korean software office and developing android & Unity3D...

I'm want sample code for WPF winform in Viewing Unity3D Project.

http://forum.unity3d.com/threads/10855-Unity-in-a-Window/page3, this is reference site. and reference materials.

For example: If click Button(In WPF), Create object unity3d in wpf viewer.

Please help me... I'm want perfect code. Not abstract...

like image 413
JavaHell Avatar asked Mar 23 '23 08:03

JavaHell


1 Answers

You can embed your Unity Standalone Application into your WPF application.

  1. Build your unity project into Unity standalone (PC).

  2. Insert WindowsFormsHost in your XAML as a container to load your Unity App.

    <WindowsFormsHost Name="windowsFormsHost" Height="700" Width="1000"/>
    
  3. Create Button in your XAML.

  4. Use ProcessStartInfo to show your Unity Application.

like image 164
Ratih Nurmalasari Avatar answered Apr 02 '23 20:04

Ratih Nurmalasari