Search Unity

Load raw UXML string.

Discussion in 'UI Toolkit' started by Krasshirsch, Jul 25, 2019.

  1. Krasshirsch

    Krasshirsch

    Joined:
    Apr 26, 2017
    Posts:
    36
    Hey,

    I have perused the documentation and found that currently one can only load a uxml file via path. That is fine if one wants to deploy the elements directly from a Unity script, but problematic if one wants to deploy editor scripts through an external dll. Is there a way or a plan to allow this via stream ?

    Regards
    Alex
     
  2. antoine-unity

    antoine-unity

    Unity Technologies

    Joined:
    Sep 10, 2015
    Posts:
    780
    Hello,

    In the case of publishing DLLs without access to Unity assets the way to go is to use the C# API, which allows you to create elements the same way you can with UXML.

    Another option which may deserve a look is to pre-build UXML assets into an asset bundle that you can then embed as a resource of your DLL.

    This post contains relevant information since there was a similar question before:
    https://forum.unity.com/threads/can-uxml-loaded-dynamically-just-like-webpage.640558/#post-4339816

    Thanks
     
    Last edited: Jul 25, 2019