icecat471 / devlog

0 stars 0 forks source link

devlog/post/unity/call_javascript/ #2

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

유니티 WebGL 자바스크립트 함수 호출 | icecat471's Devlog

참고: 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; },

https://icecat471.github.io/devlog/post/unity/call_javascript/

jollyer commented 3 years ago

좋은정보 감사합니다 ㅎㅎ