
Download from Unity Asset Store.
More about PluginYG2 — benefits and other information.
Telegram channel — updates, useful and important information.
Telegram chat — ask questions or find ready answers.
Below are video materials. It is recommended to refer to the documentation as it contains more detailed and always up-to-date information. The YouTube player may not display due to restrictions.
Getting Started
Download PluginYG2 from Unity Asset Store and import it. You're greeted by a welcome window. It duplicates buttons from the context menu:

Open the plugin settings – this is the fundamental window. Note that many fields have tooltips!

It's recommended to familiarize yourself with all parameters in the Basic Settings section.
Modular System
All plugin functions are divided into separate modules. You can read more about the advantages of this approach and the plugin overall on the home page of the site.
Open the version control tool. Let's download and import the InterstitialAdv module for example:

When the module is imported:
- It goes into the Modules folder. Any folder within the Modules directory will be identified as a plugin module.
- If the module has global settings, they will appear in the plugin settings.
- Each module will have its define (preprocessor directive link). You can use it in your code.

Module defines are suffixed with _yg. Platform modules are labeled with Platform_yg. In case of problems, check if all defines are correctly set and adjust them. You can also try updating module data in the project by deleting the PluginYourGames/Editor/ModulesListYG2.txt file.
If you discover clear issues with the plugin, please report them in the chat Plugin Your Games. There you can find discussions with ready solutions and interact about game development topics. You are encouraged to follow updates and other important information in the telegram channel PluginYG2 on call.
Working with Code
PluginYG is in the YG namespace, import it at the beginning of your script: using YG;
Almost all functions are located in the YG2 class. For example, we can find the method for calling ads in this class: YG2.InterstitialAdvShow();
For how to work with ads and other modules, see the relevant sections.
Other objects contained in PluginYG2 without separate modules:
Demo Materials

All demo materials are in the Example folders. Open the main demo scene: PluginYourGames/Example/Scenes/ExampleYG2. The main scene displays demo objects of all modules. If a module has a demo object scene, it will be displayed. But first, you need to click on the «Add Demo Scenes» button. Then module scenes will be added to Build Settings. Before releasing the game or finishing exploring the plugin, you can delete demo scenes from Build Settings by clicking the «Delete» button or perform removal of all demo materials from the project.
EventsYG2 Component

- The EventsYG2 component stores most of the plugin's available methods. It allows, for example, to assign an ad call method to a button without code.
- Using the EventsYG2 component, methods can be executed by event. To do this, click the «Add a New Event Type» button and select the event when any method should be executed. It works similarly to how you attach methods on a button click in the Button component.
Building
Now you know the basics of working with Plugin Your Games 2.0. With this knowledge, you can already assemble a working build. But there are still a couple of interesting points. Further about the build number and slightly about the correct project settings for WebGL.
Build Number
PluginYG2 stores build information in the PluginYourGames/Editor/BuildLogYG2.txt file. The build number is recorded there. For example, if you compile the project with PluginYG imported for the third time, the build number will be = 3.
The build number is displayed in the following places:
- In the Unity Editor log after compiling the project
- In the name of the zip archive of the build (suffix, for example, "b3")
- In the browser console (in the first logs)
- In the corner of the game screen during build testing (more about this below)
To reset build information, you can delete the BuildLogYG2.txt file.
You are allowed to delete the entire PluginYourGames/Editor folder to clear the plugin cache.
After compiling the project, if the Archiving Build checkbox in the plugin settings in the Basic Settings section is enabled, the game build will be automatically archived in the zip format, so you don't have to archive it manually each time. PluginYG does not delete the original build and does not place the archive inside it since the plugin does not violate any basic Unity logic when compiling a build. Therefore, the location of the created archive may seem strange. For convenience, within the folder you are going to build the build, create another folder with the same game name. And already compile the game build inside it:

Project Settings
In the plugin settings, under the Template section, the Developer Build option will aid in testing the game build. When using this option, scripts displaying the build number in the game screen corner will enter the build. This allows you to instantly ensure that the build on the platform server is up to date.
Also, the display of such a panel signals that the build is not final, which helps remind you to change project settings for the final build.

You can click on the build number panel to make it disappear.
Before the final build, you need to disable the Developer Build option. Also in Build Settings for WebGL, there's the Code Optimization option:

For saving time when compiling a test build, set the Shorter Build Time parameter. For a release build, Runtime Speed with LTO. More details in official documentation.
Other major WebGL project settings will be applied automatically by the plugin if you allowed it, more above.
By default, the Color Space option is not applied. For WebGL, it's recommended to use the Gamma value. Games for IOS and some other devices only support the Gamma mode. This also applies to the Auto Graphic API option (recommended to enable).
Of the main recommendations, there's the DSP Buffer Size option for sound - an optimization setting for sound, which can also help eliminate issues with extraneous noise, if present. In the sound settings for WebGL itself, the Load Type needs to be set to Decompress On Load. Otherwise, on mobile devices, the drawer will display a Media Player, as if the sounds of your game are music playback.
Another beginner's problem is the font not displaying on the WebGL build. The standard Unity font cannot be used, replace it. If difficulties arise, read the "Frequently Asked Questions" section (not ready yet).
I suggest an excellent article about project setup and optimization.