본문 바로가기

프로그래밍/WebGL

[WebGL] react-unity-webgl 소개

Unity WebGL이란 Unity 콘텐츠를 웹 브라우저에 실행 하는 빌드 옵션이다.

하지만 Unity WebGL을 사용 시 생각보다 제약이 많아 아쉬운 부분과 문제를 겪는 상황이 많다.

이 글에서 Unity WebGL의 제약을 어느정도 해소할 수 있는 react-unity-webgl 패키지를 소개하고자 한다.

 

React 프레임워크로 Unity WebGL을 사용하다 보면 React와 Unity 통신이 필요할 경우가 있다.

react-unity-webgl은 WebGL을 사용할 때 React와 Unity 간의 양방향 통신을 가능하게 해주는 패키지이다.

 

https://react-unity-webgl.dev/

 

React Unity WebGL

Bringing your Unity Games to the Web since 2017!

react-unity-webgl.dev

 

https://www.npmjs.com/package/react-unity-webgl

 

react-unity-webgl

React Unity WebGL provides a modern solution for embedding Unity WebGL builds in your React Application while providing advanced APIs for two way communication and interaction between Unity and React.. Latest version: 9.5.0, last published: 16 days ago. St

www.npmjs.com

 

npm install react-unity-webgl

 

설치 시 자신이 현재 사용하고 있는 Unity  버전과 호환이 되는지 확인해야 한다.

이 프로젝트에서는 Unity 2022.3.13f1 LTS 버전으로 진행한다.