Skip to content

Conversation

@NickKhalow
Copy link

Context / Problem
DOTween exposes async/Task-based instructions when targeting .NET 4.6+ / .NET Standard 2.0.
On WebGL, Task-based async APIs are not supported in a meaningful or safe way due to the single-threaded execution model and lack of real threading. This leads to silent hangs or undefined behavior rather than explicit failures.

What was changed

  • Excluded DOTween async instructions from compilation on UNITY_WEBGL.

  • Added !UNITY_WEBGL to the existing preprocessor guards for async-related code paths.

  • Applied consistently across:

    • UnityExamples
    • UnityTests (multiple Unity versions)
    • Prebuilt DOTween assembly sources

Why this approach

  • Enforces correctness at compile time, not runtime.
  • Prevents accidental usage of unsupported async APIs on WebGL.
  • Aligns with WebGL platform constraints and avoids silent runtime failures.

Impact

  • No behavior change for non-WebGL platforms.
  • On WebGL, async/Task-based DOTween APIs are no longer available, making platform limitations explicit.

Risk
Low. Change is limited to conditional compilation and does not affect runtime logic on supported platforms.

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