Unity3d Embedding WPF Tutorials

Source: Internet
Author: User

Unity3d Embedding WPF Tutorials
    1. Create a Class library project

    1. Create a Windowform custom control (UserControl)

1). Introducing Untiywebplayer COM Components

2). Drag the component into the UserControl and set the Dock property to fill so that it fills the entire control

3) After deleting untiywebplayer, generate file

3). Add a class public reference to the Unitywebplayer in the program. The purpose of this is to be able to manipulate it later (or not to add it)

4). Generate, there will be three DLL files in the bin, only two are useful. One is axinterop.unitywebplayeraxlib the other is the DLL for the custom component you defined.

    1. Bring those two useful DLLs into our WPF project. And then introduce System.Windows.Forms and Windowsformintegration.

    1. Introduces the namespace of our custom control in the Window tab of WPF XAML.  such as: xmlns:unity= "..." In <Grid>, add a <WindowsFormHost> tag that is used to host our WindowsForm custom components. And in which to add such as: <unity:unityplayer x:name= "Unityplayer";. In this way, Unitywebplayer is embedded in WPF.

The problem may be that the component is not loaded,

Unity3d Embedding WPF Tutorials

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.