Loading XAML from compiled Unity3D Resources
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?
Re: Loading XAML from compiled Unity3D Resources
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?
Re: Loading XAML from compiled Unity3D Resources
Sorry for my language, I mean Load (not download) XAML. Unity compiled resources to *.assets files, but LoadXaml() method loads existing files only.
Re: Loading XAML from compiled Unity3D Resources
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.
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.
Re: Loading XAML from compiled Unity3D Resources
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.
But, how to use LoadXaml() method in compiled Unity3D standalone player application? It's work fine in Unity3D Editor for precompiled xaml files only.
Re: Loading XAML from compiled Unity3D Resources
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...
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:
Re: Loading XAML from compiled Unity3D Resources
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.
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.
Re: Loading XAML from compiled Unity3D Resources
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?
I imagine that you are trying to expose modding to your users. Could you explain me your exact scenario?
- PandaChuZero
- Posts: 11
- Joined:
Re: Loading XAML from compiled Unity3D Resources
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?
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?
Re: Loading XAML from compiled Unity3D Resources
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.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.
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.
We made this demo with that purpose on mind. Please, let us know if you need more things in that demo.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?
Thanks!
Who is online
Users browsing this forum: Bing [Bot], gjacob-RCG and 4 guests