Troubleshooting WebGL builds on Unity. This SDK contains a set of solutions for quick and easy assembly of projects for WebGL on Unity.
The SDK contains:
- AdsManager
- CheckOrientation
- GameStatus
- GameDistribution
This is GameDistribution SDK for Unity with some changes.
Stops the game when the tab is inactive or a GameDistribution ad is playing. Depends on GameDistribution.
In the prefab "OTPWebGD" there is a field with a choice of the main orientation of the game for mobile devices. If the orientation of the user does not match the option you specified, he will see a window with a design to flip the device.
You can customize the window by changing the CheckOrientaion
prefab located in Assets/Plugins/OneTwoPlay/Web/CheckOrientation/CheckOrientaion.prefab
To check if a reward ad is ready, call the ADSManager.Instance.RewardLoaded
property.
Reward
- To call, use ADSManager.Instance.ShowReward(action)
, where action is the method to be called in case of successful ad viewing.
Mid-roll
- 2 ways to launch:
- manual -
ADSManager.Instance.ShowInter()
for example after level completion. Alternatively, add, for example, theStartMidRoll
component to the level restart button and call it by pressingShowMidRoll
. - automatic - in the OTPWebGD prefab there is an InterLoop parameter, which every InterDelay (parameter below InterLoop) will run a Mid-roll.
Pre-roll
- ad block before gameplay. It can be executed only 1 time. There are 2 ways to start:
- manual -
ADSManager.Instance.ShowPreRoll()
for example, for every button pressing the game starts. Or add, for example, theStartPreRoll
component to the game start button and callShowPreRoll
by pressing it. - automatic - in the OTPWebGD prefab there is an InterLoop parameter, which will launch Pre-roll a second after the object is initialized
If your game doesn't support showing ads after a certain period of time, don't forget to turn off InterLoop
in the "OTPWebGD" prefab on your stage
Make sure you have installed WebGL in your version of Unity!