Advertising Services||doc135336

September 20, 2022


Service:This class is a service,You can use the Game.GetService function to get

The service can only be accessed at the client

Advertising services are mainly responsible for in-game advertising playback services.

Playing advertisements can bring benefits to developers, players need to define the advertisement scene firstdefineAdPlace, if there are multiple ad scenarios, be sure to report the scenario when switching ad scenariosreportAdPlace, to play the advideoAdcan be played. Of course, the advertisement can be played only when the advertisement entrance is open.


void defineAdPlace (string place)

Define an ad scene based on the scene name

void reportAdPlace (string place)

Report an advertising scene based on the scene name

function videoAd (string place,number adIndex,function callBack)

Play an ad

function registerEnableVideoAdChange (function callBack)

When the state of the advertisement entry changes, the function is called

boolean canEnableVideoAd ()

Get ad entry status