Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deprecated code inside jslib plugins #234

Merged
merged 3 commits into from
Oct 19, 2024

Conversation

sadegh-askari
Copy link
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
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
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