👁️ 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.
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.
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.
|TRAIL0001||Task.Delay is not supported on WebGL||Threading|
|TRAIL0002||Task.Run is not supported on WebGL||Threading|
|TRAIL0003||Task.Factory.StartNew is not supported on WebGL||Threading|
|TRAIL0004||Thread.Sleep can cause unpredictable behaviour on WebGL||Threading|
|TRAIL0005||Task Parallel Library is not supported on WebGL||Threading|
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!
Updated about 1 month ago