gilzoide / unity-lottie-player

Player for Lottie animations, powered by rlottie, multithread/Job System-friendly
The Unlicense
24 stars 1 forks source link

WebGL support #4

Closed zaixiaoqu closed 5 months ago

zaixiaoqu commented 5 months ago

Cannot be used normally in webgl environment.

image
gilzoide commented 5 months ago

Hey @zaixiaoqu, thanks for the report! I've been able to reproduce here the error "Uncaught ..." using Unity 2022.3.25, although I don't get this "abnormal situation has occurred" one.

Maybe WebGL builds don't play nice with the C# Job System, we'll probably need some special handling for WebGL specifically. Shouldn't be too hard, though, running the jobs synchronously instead of async.

gilzoide commented 5 months ago

Ok, I think I found it. Disabling LOTTIE_THREAD_SUPPORT from the WebGL native build seems to fix the problem =] I'll create a PR with the fix soon.

gilzoide commented 5 months ago

Ok, this problem should be fixed in the main branch, now tagged with 1.0.0-preview1. Feel free to reopen this issue if the problem persists. Cheers \o/

zaixiaoqu commented 5 months ago

Thank you so much, I have already tested it, Perfect.