Thanks for this fantastic asset. I spent lots of time designing complex UI in Unity’s UGUI solution. It was a terrible experience most of the time. As a former front-end developer, after I saw your UI solution, I immediately bought it, and I think it has a bright future.
I like that the separation between UI and logic works great in Unity and Onejs. Also, I believe the most productivity of using OneJs + Preact will be seen in rendering repetitive elements such as lists with 1000+ elements, and 100+ cards… in Unity.
Although I worked for some time on it, I couldn’t quite know how to approach some parts of the architecture. For example, If I want to spawn a popup element that I designed using OneJs, how can I do it as this in the logic part?
Example:
...
return (
<Popup ref={ref} title={popupTitle} desc={popupDesc} />
)
and in a MonoBehaviour script:
CreatePopup("title here", "description here");
In this case, the logic part will be sending the props to the UI, and with that, We’ll be able to create as many popups as we want. To implement that, do I need to spawn a UIDocument and set its elements manually in C# since I couldn’t find a way to interact with TSX in C#?
Another example is, after designing a shop panel using OneJs, if I want to create multiple item elements inside it dynamically, how can I do it in C#?
Example:
SpawnPanel(cards: new Card[100] { new Card("Sword"), new Card("Pistol") ... });
This way, the UI components will be mostly modular and will allow me to use the same component in different areas such as one for the shop panel, one for the collections panel, etc.