Rocko Bonaparte
Topic Author
Posts: 39
Joined: 13 Oct 2020, 08:32

Unity work flow: project and file management

22 Dec 2020, 20:20

Let's get this out of the way: I've looked at the Unity3D tutorial at https://www.noesisengine.com/docs/Gui.C ... orial.html

This got things started, but now I'm worried about how where to put all my WPF files once I start to get serious. My main fear is that I will have to clean up some cruft later when I could have created and put project files in the appropriate places at the beginning.

I actually have spent a bunch of time prototyping some WPF code to try to integrate into my game project. Everything was started completely outside of my Unity's project hierarchy. Now I am trying to figure out the cleanest way to incorporate it such that I could still mess with it externally with something like Blend. What I expect to be able to do is externally work on my GUI-related code in Blend and/or Visual Studio, and then finish integration inside Unity's editor as well as the game project in Visual Studio. Or--can I reasonably expect to do everything from within the Unity Visual Studio project itself?

(So far, I've done all my GUI stuff with Visual Studio, not Blend, but I respect the documentation suggesting it for the sake of more sophisticated drawing).

Do people normally create an external, dedicated project; or is this normally just dumped into the Unity project's file structure?

I've had bad luck opening the Unity project in Blend. Conversely, I can't open the XAML files up from Unity nor the Visual Studio project it creates. From Unity, it tries to open .XAML in the web browser (I'm guessing this is a basic explorer association I can fix). From the Visual Studio Unity project, I see the code-behinds for the examples but not XAML layout files. Is there some extra configuration I should be doing? The XAML files do exist and I can poke them from explorer.

I saw one suggestion to create a Blend and/or Visual Studio project right over the top of the Unity project, but that sounded kind of messy. Is this a normal thing to do or do most people create the project either outside the Unity project or in a subfolder inside of it?
 
Rocko Bonaparte
Topic Author
Posts: 39
Joined: 13 Oct 2020, 08:32

Re: Unity work flow: project and file management

23 Dec 2020, 04:03

I think I should add that I personally have a preference to do as much development as possible outside of Unity directly. The decoupling coincidentally also helps me with unit testing. I don't know how that would work with XAML files in particular.
 
User avatar
sfernandez
Site Admin
Posts: 2984
Joined: 22 Dec 2011, 19:20

Re: Unity work flow: project and file management

23 Dec 2020, 09:45

Hi Rocko and welcome to Noesis :)

We have some topics talking about this like
viewtopic.php?f=3&t=2036&p=11407&hilit=workflow#p11407
viewtopic.php?f=3&t=818&hilit=workflow&start=10#p10711
viewtopic.php?f=3&t=818&hilit=workflow&start=20#p11869

Using Unity project to edit xaml files is not possible because that project doesn't contain the required WPF assemblies. The basic idea is to have a separate Blend project that shares most of the application files with Unity but allows you to edit xamls in Blend designer. You can achieve that by having the Assets folder structure inside the Blend project, and this is what you get when using our Unity template for Visual Studio (files specific to WPF like App.xaml will be left out of Unity assets). Once you have that set up, it is as easy as work in Blend and switch back to Unity to see how the changes look.

Who is online

Users browsing this forum: Google [Bot] and 42 guests