Skip to content

Update deprecated code inside jslib plugins#234

Merged
GabrielePicco merged 3 commits intomagicblock-labs:mainfrom
sadegh-askari:main
Oct 19, 2024
Merged

Update deprecated code inside jslib plugins#234
GabrielePicco merged 3 commits intomagicblock-labs:mainfrom
sadegh-askari:main

Conversation

@sadegh-askari
Copy link
Copy Markdown
Contributor

Status Type ⚠️ Core Change Issue
Ready Hotfix No Link

Problem

In the WebGL build of Unity 2023 and above, when enabling the "Target WebAssembly 2023" option in Player Settings > Publishing Settings, the game freezes after the initial loading.

Solution

According to the Unity documentation at the link below:
https://docs.unity3d.com/6000.0/Documentation/Manual/web-interacting-browser-deprecated.html#dyncall
the dynCall() function has been deprecated and should be replaced with makeDynCall().
Please note that this change is backward-compatible, and there will be no issues even if the "Target WebAssembly 2023" option is not enabled.

As a result, I replaced this deprecated function with the new version in all the existing jslib plugins in your SDK, and ultimately, the issue with my build in Unity 6 was resolved when "Target WebAssembly 2023" was enabled.

Other changes (e.g. bug fixes, small refactors)

Also, the allocate function was used in the WebGLInput plugin, which has also been deprecated, and I replaced it with its new equivalent.

Copy link
Copy Markdown
Collaborator

@GabrielePicco GabrielePicco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sadegh-askari, just a minor comment on naming, but LGTM!

Copy link
Copy Markdown
Collaborator

@GabrielePicco GabrielePicco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM

@GabrielePicco GabrielePicco merged commit 90edc61 into magicblock-labs:main Oct 19, 2024
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.

2 participants