Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
290 views
in Technique[技术] by (71.8m points)

Problem with adding AdMob to my Godot project

I have a problem that I can't solve: I have everything configured so that an ad appears when a button is pressed and it works correctly but I want it to appear only the first time the button is pressed. To do this I have created a variable to check whether or not I have pressed the button once, I put the instruction to display the ad within a condition that validates the variable and by doing this the ads are never seen. Does anyone have any idea what might be happening?

var verAnuncio = true

func _ready() -> void:
    admob.load_interstitial()

func _on_colocar_pressed() -> void:
    if verAnuncio == true:
        admob.show_interstitial()
        verAnuncio = false

I use this plugin for godot: https://github.com/Shin-NiL/Godot-Android-Admob-Plugin

question from:https://stackoverflow.com/questions/65682367/problem-with-adding-admob-to-my-godot-project

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...