Skip to content

Fix around WebGL global array get/sync APIs - #18

Open
kshoji wants to merge 3 commits into
ccrma:mainfrom
kshoji:feature/fix-webgl-supports
Open

Fix around WebGL global array get/sync APIs#18
kshoji wants to merge 3 commits into
ccrma:mainfrom
kshoji:feature/fix-webgl-supports

Conversation

@kshoji

@kshoji kshoji commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

WebGL builds failed or behaved incorrectly when fetching or syncing ChucK global int/float arrays.
The several array-related plugin exports were missing or wired incorrectly.

Changes

WebGL array get API

  • Add GetIntArray / GetFloatArray overloads that take (variableName, gameObjectName, methodName) on Chuck, ChuckMainInstance, and ChuckSubInstance.
  • Fix the broken WebGL GetFloatArray function.

AudioPluginChuck.jslib

  • Implement getGlobalIntArrayWithUnityStyleCallback / getGlobalFloatArrayWithUnityStyleCallback, delivering arrays as JSON ({"items":[...]}) via SendMessage.
  • Add missing Named / WithID / _AT exports referenced by C# DllImports so WebGL linking succeeds.
  • Replace deprecated Pointer_stringify with UTF8ToString for newer Unity compatibility.

Syncers and examples

  • ChuckFloatArraySyncer / ChuckIntArraySyncer: on WebGL, parse the JSON SendMessage payload into managed arrays while keeping the same public syncer API.
  • ChunityExampleGlobalFloatArray / ChunityExampleGlobalIntArray: use WebGL Unity-style get APIs and instance methods suitable for SendMessage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant