Unity Scene within XAML
Hi,
Does anyone have an example or guidance on how to best embed a Unity 3D scene on an area of a XAML page/control?
Can the 3D scene be interactive while embedded in the XAML?
The basic idea I am told is this:
Use a RenderTexture, connect that texture to the XAML and render the unity scene in that texture.
Thanks in advance.
Fred
Does anyone have an example or guidance on how to best embed a Unity 3D scene on an area of a XAML page/control?
Can the 3D scene be interactive while embedded in the XAML?
The basic idea I am told is this:
Use a RenderTexture, connect that texture to the XAML and render the unity scene in that texture.
Thanks in advance.
Fred
Re: Unity Scene within XAML
Hi Fred,
We are going to create a sample showing this because it has been requested many times in the past. The steps do be done are:
We are going to create a sample showing this because it has been requested many times in the past. The steps do be done are:
- You need to create a RenderTexture in Unity and have a camera rendering to it. This is described in the Unity docs. The scene can be interactive and animated. You can update it at realtime.
- You need to use that RenderTexture in a xaml. For that, you need a named image node whose source you will change. This step must be done only once.
Code: Select all
Grid grid = GetComponent<NoesisGUIPanel>().GetRoot<Grid>();
Image img = grid.FindName<Image>("img");
img.SetSource(new TextureSource(renderTexture));
Who is online
Users browsing this forum: Semrush [Bot] and 8 guests