Closed UltimateEternal closed 3 months ago
C#端代码:
public static void TestArrayBuffer(Puerts.ArrayBuffer buffer) { StringBuilder builder = new StringBuilder(); byte[] bytes = buffer.Bytes; int length = buffer.Count; for (int i = 0; i < length; ++i) { builder.Append($"{bytes[i]} "); } Debug.Log($"TestArrayBuffer: {builder.ToString()}"); }
js代码:
let buffer = new ArrayBuffer(8); let view = new DataView(buffer); view.setUint32(0, 90008, false); CS.AppDelegate.TestArrayBuffer(buffer);
输出结果: TestArrayBuffer: 68 189 44 0 68 189 44 0
团结引擎1.2.0+Puerts WebGL 2.0.5+微信开发者工具
1.编写C#代码并导出wrapper 2.导出微信小游戏工程 3.运行
重新build一下puerts-runtime.js 路径:puerts_unity_webgl_demo\packages\webgl\upm\Javascripts~
error log | 日志或报错信息
C#端代码:
js代码:
输出结果: TestArrayBuffer: 68 189 44 0 68 189 44 0
context | 编译/运行环境
团结引擎1.2.0+Puerts WebGL 2.0.5+微信开发者工具
how to reproduce | 复现步骤
1.编写C#代码并导出wrapper 2.导出微信小游戏工程 3.运行