Page 1 of 1

How to change NoesisView.Xaml in Runtime?

Posted: 06 Feb 2023, 07:54
by sericaer
Hi, I'm try to change the NoesisView.Xaml in runtime.

I create a script and attach to the obj which has the NoesisView component. But the 'test.xaml' gui not show when project run.
public class DynamicXmal : MonoBehaviour
{
    void Awake()
    {
        var xaml = ScriptableObject.CreateInstance<NoesisXaml>();
        xaml.content = File.ReadAllBytes(Path.Combine(Application.streamingAssetsPath, "test.xaml"));
        xaml.Load();

        var view = GetComponent<NoesisView>();
        view.Xaml = xaml;
    }
}
NoesisGUI version is 3.1.6. Unity version is 2022.1.6f1c1
Thanks a lot!