Q
Q
Qerriom Magnelius2022-04-19 21:27:47
C++ / C#
Qerriom Magnelius, 2022-04-19 21:27:47

How to make ads in Unity (there is a code that, as I understand it, does not work)?

Hello! I tried to make an ad, but one stupidly does not show up ... Help please, are there any options?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Advertisements;

public class ads : MonoBehaviour
{
    
    // Start is called before the first frame update
    void Start()
    {
        if (Advertisement.isSupported)
        {
            Advertisement.Initialize("4714877", false);
        }
    }

    // Update is called once per frame
    void Update()
    {
        
    }
    void OnTriggerEnter(Collider other) 
    {
        if (Advertisement.IsReady())
        {
            Advertisement.Show("video");

        }
    }
    
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question