alaplace
Topic Author
Posts: 3
Joined: 29 Nov 2017, 19:54

Correct way to integrate visual studio xaml blend project into unity3d

29 Nov 2017, 20:06

For days i was trying to make an integration that works properly in unity3d. I need to copy all resources on a postbuild event, from the visual studio project that contains the xaml components, because the assets in that projects are being reutilized in 3 unity3d different projects.
When unity3d import the assets that the postbuild just copy. some references in the generated assets are lost, for example all the fonts. And when i try to execute the application i get an exception like this.
Noesis.dll caused an Access Violation (0xc0000005)
in module Noesis.dll at 0033:80f46f54.
Can you help me?
 
User avatar
jsantos
Site Admin
Posts: 1869
Joined: 20 Jan 2012, 17:18
Contact:

Re: Correct way to integrate visual studio xaml blend project into unity3d

30 Nov 2017, 13:31

The recommended approach we are following in our samples is described in this tutorial.

Your approach is a bit different because you are replicating files manually. I need to understand what do you mean with "some references in the generated assets are lost" but before that, please, confirm me you are using the latest 2.1 beta for Unity.
 
alaplace
Topic Author
Posts: 3
Joined: 29 Nov 2017, 19:54

Re: Correct way to integrate visual studio xaml blend project into unity3d

30 Nov 2017, 14:50

confirm me you are using the latest 2.1 beta for Unity
At the moment we are using NoesisGUI-2.0.2f2 version of Noesis for Unity
I need to understand what do you mean with "some references in the generated assets are lost"
We are losing the references to the Fonts, in the generated asset file generated from font definition file. Here is a pick:
Image.
This is the asociated xaml font definition file:
Image
 
User avatar
jsantos
Site Admin
Posts: 1869
Joined: 20 Jan 2012, 17:18
Contact:

Re: Correct way to integrate visual studio xaml blend project into unity3d

01 Dec 2017, 00:46

I don't understand those "None"s as Font dependencies. The only explanation that makes sense to me is that the fonts were removed from the Unity project at some point...

Could it be possible that the XAML is copied before its fonts to the destination directory? Whenever the XAML is copied, we analyze it to scan its dependencies. If fonts are not available at that point and you copy them later, you need to reimport the XAML. This could be an explanation to the missing fonts but not to the None entries. Apart from that, we shouldn't be crashing in any circumstance. That's something I need to understand also,

Besides, I recommend you switching to the 2.1 version, don't be scared about the beta thing... Many customers are already using it.
 
alaplace
Topic Author
Posts: 3
Joined: 29 Nov 2017, 19:54

Re: Correct way to integrate visual studio xaml blend project into unity3d

01 Dec 2017, 13:31

Could it be possible that the XAML is copied before its fonts to the destination directory?
We have been doing some test, in that particular case, we start from blank, we built the blend project, the resources were copied, and then we open unity, so the resources were already there. There is some posibility that the plugin analizes the xaml before that the ttf because the folder hierarchy?
Besides, I recommend you switching to the 2.1 version, don't be scared about the beta thing
Ok we will try that version, and tell you the result
 
User avatar
jsantos
Site Admin
Posts: 1869
Joined: 20 Jan 2012, 17:18
Contact:

Re: Correct way to integrate visual studio xaml blend project into unity3d

04 Dec 2017, 11:54

We have been doing some test, in that particular case, we start from blank, we built the blend project, the resources were copied, and then we open unity, so the resources were already there. There is some posibility that the plugin analizes the xaml before that the ttf because the folder hierarchy?
We always process fonts before xamls (you can see the code in NoesisPostProcessor.cs). My suspicion is that Unity is invoking OnPostprocessAllAssets several times. You can force a global reimport of XAMLs by doing this (exactly the same code used when you do that using the noesis settings panel):
NoesisPostprocessor.ImportAllAssets();
That should fix your issues.

Who is online

Users browsing this forum: No registered users and 8 guests