类型 函数 返回值 布尔值 修订版 版本 2024.3703 关键词 广告、广告宣传、Unity 广告、isLoaded 另请参阅 unityads.show() unityads.*
返回一个 布尔值,指示广告是否已加载且可展示。
unityads.isLoaded( placementId )
local unityads = require( "plugin.unityads.v4" )
-- 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" ) )