Unity WebGL에는 jslib에서 javascript 함수를 호출하는 메서드가 있지만 firebase를 사용하기 위해 이러한 함수 호출을 node.js에 통합해야합니다. 내가 할 노력은 무엇Unity3D를 통해 node.js에서 javascript 함수를 호출합니까?
은 다음과 같다 :
유니티 내부 내가 지금과 같은 외부 호출하려고 노력에서 그런// entry.js:
require("./style.css");
document.write(require("./content.js"));
require('./UnityLoader.js');
var firebase = require('firebase');
function foo() {
window.alert("ENTRY HELLOW WORLD");
}
wvar gameInstance = UnityLoader.instantiate("gameContainer", "Build/WebGLNodeContainer.json");
document.write('<div id="gameContainer" style="width: 960px; height: 600px; margin: auto"></div>');
:
public class FirebaseWebGL : IFirebaseLib
{
[DllImport("__Internal")]
private static extern void foo();
public void Login(string username, string password)
{
foo();
}
}
나는이 'didn를 너무 놀라지 아니에요을 그 중 Unity's docs claim you can call javascript in your webpage 지침은 node.js/webpack과 잘 작동하지 않는 유니티 프로젝트에 자바 스크립트 파일로 패키징하는 것과 관련이 있습니다.
이 방법이 있습니까? 필자의 주요 목표는 firebase 로그인을 유도하고 인증 토큰을 가져 오는 것입니다.