-
- Nir Hasson
- Posts: 71
- Joined:
- Contact:
Noesis.GUI.LoadXaml not working on Unity 2021.3 with Version 3.1.5
Hi,
After upgrading to Noesis 3.1.5 from Noesis 3.0.1 it seems that Noesis.GUI.LoadXaml no longer works and always returns null.
We used to be able to call it with a partial filename and get a valid object.
I.E A call to Noesis.GUI.LoadXaml("Assets/Spivi/UI/WorkoutGroupParticipants.xaml") used to work but no longer works.
What am I doing wrong?
After upgrading to Noesis 3.1.5 from Noesis 3.0.1 it seems that Noesis.GUI.LoadXaml no longer works and always returns null.
We used to be able to call it with a partial filename and get a valid object.
I.E A call to Noesis.GUI.LoadXaml("Assets/Spivi/UI/WorkoutGroupParticipants.xaml") used to work but no longer works.
What am I doing wrong?
Re: Noesis.GUI.LoadXaml not working on Unity 2021.3 with Version 3.1.5
That scenario was dangerous in 3.0 because even though it was working in the Editor, in standalone you will get a null as the XAML is not being referenced anywhere and optimized out by Unity.
So, the recommended approach now is having a strong reference to the XAML you want to load (for example, storing it in a public property of a MonoBehaviour and then using NoesisXaml.Load method.
Note that, if the XAML is a dependency to other XAML, then the function Noesis.GUI.LoadXaml will work correctly because it is already reference by another resource.
So, the recommended approach now is having a strong reference to the XAML you want to load (for example, storing it in a public property of a MonoBehaviour and then using NoesisXaml.Load method.
Note that, if the XAML is a dependency to other XAML, then the function Noesis.GUI.LoadXaml will work correctly because it is already reference by another resource.
-
- Nir Hasson
- Posts: 71
- Joined:
- Contact:
Re: Noesis.GUI.LoadXaml not working on Unity 2021.3 with Version 3.1.5
We do have a strong reference to these xaml files, but still can't load them in runtime.
I did some additional test, after entering play mode when I explicitly reimport the target asset and then try to load it works.
I did some additional test, after entering play mode when I explicitly reimport the target asset and then try to load it works.
-
- Nir Hasson
- Posts: 71
- Joined:
- Contact:
Re: Noesis.GUI.LoadXaml not working on Unity 2021.3 with Version 3.1.5
I think I found the source of the issue.
In the specific case where the issue happens, the object that holds a reference to the xaml was a prefab.
When I unpacked the prefab the reference kept and everything worked as expected.
In the specific case where the issue happens, the object that holds a reference to the xaml was a prefab.
When I unpacked the prefab the reference kept and everything worked as expected.
Re: Noesis.GUI.LoadXaml not working on Unity 2021.3 with Version 3.1.5
If you have a strong reference, the recommend way to load its xaml is using Load()We do have a strong reference to these xaml files, but still can't load them in runtime.
Code: Select all
public class NoesisXaml: ScriptableObject
{
public object Load()
{
RegisterDependencies();
NoesisUnity.Init();
return Noesis.GUI.LoadXaml(new MemoryStream(content), uri);
}
Who is online
Users browsing this forum: Ahrefs [Bot] and 2 guests