Type Function Return value Boolean Revision 2017.3060 Keywords ads, advertising, Unity Ads, isLoaded See also unityads.show() unityads.*
Returns a boolean indicating whether an ad is loaded and ready for display.
Calling this function will also trigger an adsRequest event with a phase of "placementStatus"
. For this event, event.data will contain additional information about the status of the placement ID.
unityads.isLoaded( placementId )
local unityads = require( "plugin.unityads" ) -- Unity Ads listener function local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization print( event.provider ) end end -- Initialize the Unity Ads plugin unityads.init( adListener, { appId="YOUR_UNITYADS_GAME_ID" } ) -- Sometime later, check if an ad (placement ID) is ready for display print( unityads.isLoaded( "YOUR_UNITYADS_PLACEMENT_ID" ) )