类型 函数 返回值 布尔值 修订 版本 2024.3703 关键字 广告,广告宣传,Unity 广告,isLoaded 另请参阅 unityads.show() unityads.*
返回 布尔值 以指示广告是否已加载且已准备好显示。
调用此函数还会触发 adsRequest 事件,其 阶段 为 "placementStatus"
。对于此事件,event.data 将包含有关展示位 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" ) )