브라우저에서 유니티 함수 호출하기

참고: Unity Document WebGL build시 생성되는 unityInstance에 메세지를 보내서 호출. unityInstace.SendMessage('오브젝트명', '함수명');

April 12, 2021 · 1 min · icecat471

유니티 WebGL 자바스크립트 함수 호출

참고: Unity Document WebGL Assets/Plugins 폴더를 만들고 Plugin.jslib 파일을 만든다 // Plugin.jslib mergeInto(LibraryManager.library, { Hello: function () { window.alert("Hello, world!"); }, HelloString: function (str) { window.alert(Pointer_stringify(str)); }, PrintFloatArray: function (array, size) { for(var i = 0; i < size; i++) console.log(HEAPF32[(array >> 2) + i]); }, AddNumbers: function (x, y) { return x + y; }, StringReturnValueFunction: function () { var returnStr = "bla"; var bufferSize = lengthBytesUTF8(returnStr) + 1; var buffer = _malloc(bufferSize); stringToUTF8(returnStr, buffer, bufferSize); return buffer; }, BindWebGLTexture: function (texture) { GLctx....

April 12, 2021 · 1 min · icecat471

터미널에서 command not found: dotnet 에러

아래처럼 나올 때 zsh: command not found: dotnet dotnet package를 설치했다면/usr/local/share/dotnet 경로에 설치되어 있는 것을 확인./usr/local/bin 경로에 링크를 만들어주면 된다.ln -s /usr/local/share/dotnet/dotnet /usr/local/bin 출처: stackoverflow

April 12, 2021 · 1 min · icecat471

유니티 webGL 프로젝트 로컬서버에서 실행하기

webGL “build and run” 버튼을 눌러서 실행하면 빌드가 다시 되기때문에 시간이 오래걸림로컬에서 서버를 열어서 실행해볼 수 있다. http-server 설치 $ npm i -g http-server 실행 // 유니티 빌드 폴더로 이동 $ http-server Starting up http-server, serving ./ Available on: http://127.0.0.1:8080 http://120.50.93.152:8080 http://192.168.2.1:8080 Hit CTRL-C to stop the server http://localhost:8080 로 접속해보면 게임이 실행된것을 확인해 볼 수 있다.

April 11, 2021 · 1 min · icecat471