NativeAd.ts 442 Bytes
import AdManager from "./AdManager";

export default class NativeAd extends Laya.Script {
    onEnable(): void {
        let globalPoint = this.item.localToGlobal(Laya.Point.EMPTY, true);
        AdManager.I.showNativeAd(globalPoint.x, globalPoint.y, this.item.width, this.item.height);
    }

    onDisable(): void {
        AdManager.I.closeAdverDialog();
    }

    private get item(): Laya.View {
        return this.owner as any;
    }
}