react-unity-hooks
CommunityBridge React and Unity WebGL with event hooks.
System Documentation
What problem does it solve?
React applications embedding Unity WebGL often struggle with reliable, maintainable cross-framework communication. This Skill provides reusable event hooks to send messages to Unity and listen for Unity callbacks, reducing boilerplate and synchronization issues.
Core Features & Use Cases
- Send to Unity: useSendUnityEvent to dispatch Unity messages from React.
- Listen from Unity: useListenForUnityEvent to handle Unity events in React components.
- Patterns and architecture: clear separation between React and Unity messaging layers, with lifecycle-aware hooks.
- Use Case: trigger a Unity animation from a React button, then handle a Unity event to update UI accordingly.
Quick Start
Install the react-unity-webgl package and include the Skill's hooks in your project. Import and use useSendUnityEvent to dispatch messages to Unity and useListenForUnityEvent to react to Unity callbacks. Ensure Unity is initialized (UnityLoader and WebGL build) and then implement a simple flow: send a message to Unity and handle a corresponding Unity event in React.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: react-unity-hooks Download link: https://github.com/danielctc/ReactSpacesMonoRepo/archive/main.zip#react-unity-hooks Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.