pmike
Topic Author
Posts: 28
Joined: 31 Oct 2012, 09:29

Loading XAML from compiled Unity3D Resources

10 Jul 2014, 16:17

Does the analog to method NoesisGUISystem.LoadXaml<T>(xamlFileName) to download XAML resources from Unity3D resources exists? Or are there other ways to download from the Unity3D resources?
 
User avatar
jsantos
Site Admin
Posts: 2906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Loading XAML from compiled Unity3D Resources

11 Jul 2014, 01:09

Hi, sorry but I am not sure to understand when you say download from the Unity3D resources. Could you elaborate please? Do you mean loading a XAML from the web?
 
pmike
Topic Author
Posts: 28
Joined: 31 Oct 2012, 09:29

Re: Loading XAML from compiled Unity3D Resources

11 Jul 2014, 07:42

Sorry for my language, I mean Load (not download) XAML. Unity compiled resources to *.assets files, but LoadXaml() method loads existing files only.
 
User avatar
jsantos
Site Admin
Posts: 2906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Loading XAML from compiled Unity3D Resources

11 Jul 2014, 11:37

Do you mean AssetBundles, right?

We didn't investigate that option yet. We store all preprocessed xamls in the /StreamingAssets folder. I don't know if that option will be compatible with AssetBundles or if Unity will allow us to store our resources inside them.

If this is an important feature for you, please file a bug. Although for now we cannot prioritize this.
 
pmike
Topic Author
Posts: 28
Joined: 31 Oct 2012, 09:29

Re: Loading XAML from compiled Unity3D Resources

11 Jul 2014, 15:17

AssetBundles and standard Unity Resources subdir with assets, right.
But, how to use LoadXaml() method in compiled Unity3D standalone player application? It's work fine in Unity3D Editor for precompiled xaml files only.
 
User avatar
jsantos
Site Admin
Posts: 2906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Loading XAML from compiled Unity3D Resources

12 Jul 2014, 12:49

LoadXaml() only works with .xaml resources that you have under your /Assets project folder. For now it cannot be used to open AssetBundles or external XAMLs.

If LoadXaml() works for your fine in the editor it should also work in standalone. Please, make sure that you have your mobile platform activate in the NoesisGUI settings menu.

Not sure if this answers your questions...
 
PandaChuZero
Posts: 11
Joined: 06 May 2014, 06:05

Re: Loading XAML from compiled Unity3D Resources

19 Aug 2014, 17:32

We need a way to load xaml at run time.

A method called LoadXamlFromString that takes a xaml string argument instead of a filepath would work.

NoesisGUISystem.LoadXamlFromString<T>(string someXamlString);

Let us handle the getting it from the file, we just need a way to convert it into some sort of basecomponent.
 
User avatar
jsantos
Site Admin
Posts: 2906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Loading XAML from compiled Unity3D Resources

20 Aug 2014, 13:43

Problem is that the runtime does not understand XAML files directly. The XAML parser is very big and it is excluded from the unity standalone for efficiency reasons. In v1.2 you can use (even embed in your tool) the buildtool to preprocess the xaml.

I imagine that you are trying to expose modding to your users. Could you explain me your exact scenario?
 
PandaChuZero
Posts: 11
Joined: 06 May 2014, 06:05

Re: Loading XAML from compiled Unity3D Resources

21 Aug 2014, 03:39

Basically i am trying to create a series of menu panels like, Play / Options / Level Select etc..

I'm modelling it after the control gallery example which uses LoadXaml<> to get the different panels and transition them when the player clicks an option in the tree. This works great in the editor because it's reading off disk.

The problem is for things like Android, IOS or anything where the assets are bundled using resources, streamingassets, asset bundles or downloaded to the persistant datapath, this approach won't work.

Now i can for my current project just make a monolithic menu system using a single xaml which is ok. But it was my understanding that taking a more compartmentalized approach was better.

Maybe an example or tutorial with a basic game menu system with some simple transitions would go a long way to helping people put things together.

What do you think?
 
User avatar
jsantos
Site Admin
Posts: 2906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Loading XAML from compiled Unity3D Resources

21 Aug 2014, 15:16

I'm modelling it after the control gallery example which uses LoadXaml<> to get the different panels and transition them when the player clicks an option in the tree. This works great in the editor because it's reading off disk.

The problem is for things like Android, IOS or anything where the assets are bundled using resources, streamingassets, asset bundles or downloaded to the persistant datapath, this approach won't work.
Yes, it works. why not? The control gallery sample works in iOS and Android also. Each XAML is stored in the /StreamingAssets folder and you can load then individually.

Problem is when you want to load a new XAML that was not in your project at Build time. We are working on that problem in v1.2, but we need feedback about it.
Maybe an example or tutorial with a basic game menu system with some simple transitions would go a long way to helping people put things together.

What do you think?
We made this demo with that purpose on mind. Please, let us know if you need more things in that demo.

Thanks!

Who is online

Users browsing this forum: Google [Bot] and 1 guest