//使用yarn安装
yarn add hs-web3d-core
//使用npm安装
npm install hs-web3d-core
var client = null;
import {web3DCoreSocket} from './index.esm.js';
var wsUrl = "ws://192.168.2.201:8089/hs-core"
const ws = new web3DCoreSocket(wsUrl, {
appId: "1",
sessionId: "1",
})
ws.onMessage(data => {
console.log(data)
})
$(".changeColor").click(function () {
ws.sendToEngin({
"code": "21u3i21i21g4i1192982u3",
"function": "CubeControl.ChangeColor",
"type": "noCallBack",
"parameters": {"id": "2", "color": "red"}
}
)
})
Generated using TypeDoc