crypt1c
Topic Author
Posts: 4
Joined: 22 Dec 2020, 18:37

Blend & Unity Workflow

31 Jan 2021, 07:16

Hey Guys:

I've got a project setup that can be compiled in Unity and Blend, but adding new UserControls is a pain.

The code for the controls lives in the Assets folder, but the Visual Studio projects live elsewhere. I don't know an easy way to add a new file to a project that lives outside the projects dir structure.

Also, I've tried creating a new UserControl with the Visual Studio template, but a chunk of code needs to be changed in both the code (xaml.vs) and layout (xaml) files to get it to compile in both environments.

Do you guys have an easier way of doing this?

Thanks.
-Erik
 
crypt1c
Topic Author
Posts: 4
Joined: 22 Dec 2020, 18:37

Re: Blend & Unity Workflow

31 Jan 2021, 19:08

To clarify things a bit, I've used the Visual Studio addon to generate a Noesis project for Unity, but the solution/project it creates assumes that everything exists under that project's dir structure.

I'm trying to get something working that looks more like this:
project root
|==> Assets
|    |==> UI
|        |==> UserControls .xaml/.xaml.cs
|==> UITest
|    |==> Blend Project .sln/.prj
In order to add a new custom UserControl, I have to:

1. Open a template I created for new UserControls that has all the header guards in it (#ifdef NOESIS, etc).
2. Save that as a new file in the Assets folder.
3. Manually edit the project file to include the new UserControl as a reference in a subdir outside of the project folder.
4. Open the project in Blend.
5. Edit the control within Blend.

I'm thinking of writing a couple of simple scripts to generate the VS project from my Asset structure and generate a new UserControl, but wanted to ask you guys about it first.
 
User avatar
sfernandez
Site Admin
Posts: 2991
Joined: 22 Dec 2011, 19:20

Re: Blend & Unity Workflow

01 Feb 2021, 17:35

Hi,

One of the benefits of having Assets folder inside Blend project is you can directly work on Blend project and new controls will automatically be compiled and usable by Unity. This is why our project template for Visual Studio builds the project like that.

If you see our samples always follow the same folder structure:
Project/
  Project.sln
  <blend-only files>
  Assets/
    <blend-unity shared files>
And using #if to define the corresponding namespaces for Blend and Unity.

In case you want to have separate folders, in your Blend project you can use "Add > Existing Item... > Add As Link" (this option appears in the dropdown of the Add button), instead of modifying the project manually. But we don't recommend this approach because it is harder to make images or font resources that live inside Assets folder to properly work in Blend.

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 14 guests