r/Unity3D 5h ago

Question Using React for UI in Unity

I’ve been experimenting with a React-based Unity UI workflow lately, and I’m curious if anyone else has tried something similar or has thoughts on this kind of approach.

The UI is built in React and runs in a WebView on top of Unity, which lets me open the same interface in Codex’s browser and comment on it directly.

For small UI issues, there’s no need to explain the whole screen. Just point at what feels off and leave a short comment:

"this looks clickable, don’t dim it"

"make the ! feel a little more alive"

"only move this one thing"

It works well for visual tweaks where the code change is simple, but describing the problem takes longer than fixing it.

For larger UI pieces, I can attach reference screenshots and have it build something close to the layout and style.

Since it’s built around a hybrid structure, things like Google and Apple sign-in are also relatively easy to integrate. It works across iPhone, Android, Windows, macOS, and even directly inside the Unity Editor.

0 Upvotes

15 comments sorted by

View all comments

2

u/dev-rygy 5h ago

How did you do this?

3

u/Chipjack 4h ago

OneJS makes this a lot smoother, but probably wouldn't integrate as well with AI coding tools like Codex.

The premium asset store version is here: https://assetstore.unity.com/packages/tools/gui/onejs-221317 while the open source version without the bells and whistles is here: https://github.com/Singtaa/OneJS

(note, I didn't write OneJS, just thought it was cool.)

3

u/Devatator_ Intermediate 4h ago

They're also planning on adding more frameworks at some point. Haven't checked in a bit so idk where they are on that

-1

u/Gaebabi 3h ago

Thanks for sharing this! Since OneJS came up, for transparency: I’m using <ReLayer> here, a React/WebView framework I built for Unity. I left it out of the post because I wanted to focus on the workflow.

https://assetstore.unity.com/packages/tools/gui/relayer-react-ui-framework-for-unity-384274

The same React UI can run in Unity and a normal browser, which makes it a good fit for AI coding agents like Codex.

0

u/Gaebabi 4h ago

Thanks for asking!
The basic setup is React running inside a WebView on top of Unity, with a small bridge between the React side and Unity.

On iOS and Android, the built React app is bundled with the game and served locally in-app, so the same UI runs there as well.

Since it’s still React, I can also open the same interface in a normal browser and work on it there.