Code Analyzer

How to find issues and incompatibilities in your WebGL Unity game?

Pley Analyzer is a Roslyn-based code analyzer for .NET C# projects (designed specifically for Unity Games) to identify any Pley platform and WebGL incompatibilities.

When porting, you'll sometimes find that WebGL doesn't support all of your game's libraries or functionalities. Sadly, Unity does not warn you of these incompatibilities, often leading to difficult-to-troubleshoot errors.

The Pley Code Analyzer adds warnings into both Unity and Visual Studio for known incompatibilities -- saving you time in both research and troubleshooting.


Continuous Expansion

The Code Analyzer scans your code, searching for known incompatibilities. As Pley ports games and learns more, the set of rules is continuously expanded to further accelerate your WebGL porting. The Pley Code Analyzer lets you gain Pley's knowledge without yourself having to blindly explore.

Installing & Using the Pley Code Analyzer

1) Download the Pley Code Analyzer (.tgz package)

2) Install the package through Unity's built-in Package Manager > + icon > Add package from tarball...

3) Done! You'll now get automatic warnings when using webGL-incompatible methods.


Window > Package Manager > + icon > Add package from tarball > Select Pley Code Analyzer Tgz (Problem? Click here!)


Warnings as you'd expect

After adding the analyzer to your Unity project, you'll get warnings in both Unity and IDE when WebGL-incompatible code is used. This is the type of functionality you'd expect from Unity and .NET C# solutions, but doesn't exist for WebGL without the Pley Code Analyzer.


The analyzer creates what you'd expect in Unity; warnings and errors when your code won't behave as intended.


The Code Analyzer will also create warnings in the Visual Studio Editor & error list!

Analyzer Diagnostics

Diagnostic IDTitleCategory
TRAIL0001Task.Delay is not supported on WebGLThreading
TRAIL0002Task.Run is not supported on WebGLThreading
TRAIL0003Task.Factory.StartNew is not supported on WebGLThreading
TRAIL0004Thread.Sleep can cause unpredictable behaviour on WebGLThreading
TRAIL0005Task Parallel Library is not supported on WebGLThreading


Fixes to Diagnostic Warnings

The default fix to problems is automatically recommended inside your IDE; suppress the code by commenting it out or replacing the code. If there is a great default solution, it will be added as an automatic suggestion!