LogoLogo
  • ReneVerse Tour
    • 👋Welcome to ReneVerse
      • 🧠Smart Ads & Branded Objects
      • 📈Advertising Demand via ReneVerse
      • 🔮The Portal
      • 🧰The SDKs
  • Getting Started
    • 🚀Getting Started with ReneVerse
    • 📝Registering as a New User
    • 👨‍👩‍👧‍👦Creating a New Organization
    • 👥Invite Members to Your Team
  • Publisher Flow
    • 🕹️Publisher Overview
    • ⚡Quick Start Guide
    • 💾Registering Your Game & Generating API Keys
    • 🧩SDK Integration
      • 🛠️Unity
        • 🔧Unity SDK Setup
        • 🔨[WIP] Using the Unity SDK
          • 🥞Batch Serve Ad
      • 🎮Unreal Engine
        • ⚙️UE SDK Setup
        • 🔩Using the UE SDK
      • 🌐Phaser 3
        • 💫Phaser Quick Start
        • 🧪API Reference
          • 🪝useReneVerse
          • 📊useTracking
        • 💻Full Implementation (Code)
    • 🎯Defining Placeholders in the Portal
      • 🖼️Creating Ad Surfaces in the Portal
      • 🏎️Creating Branded Object Placements in the Portal
    • 📲Ads.txt
  • Advertiser Flow
    • Advertiser Overview
    • Creating Ad Campaign
    • Managing Brands
      • Creating Branded Collections
      • Brand Creation
      • Asset Creation
    • Adding Ads to Campaign
    • Creating Branded Assets
  • Download
    • Unity SDK
    • Unreal Engine SDK
    • Phaser NPM Package
Powered by GitBook
LogoLogo

ReneVerse

  • Website
  • Sign Up
  • Book a demo

Download

  • Unity SDK
  • Unreal Engine SDK
  • Phaser NPM

Links

  • Blog
  • About
  • Play Demo
  • FAQs

Socials

  • LinkedIn
  • X (Twitter)
  • YouTube

© 2025 ReneVerse

On this page
  • About Batch Serve Ad
  • 📦 How It Works
  • 🧪 Preview in Unity Editor
  • 🧑‍💻 Runtime Integration
  • ❌ Batch Disable Ads
  1. Publisher Flow
  2. SDK Integration
  3. Unity
  4. [WIP] Using the Unity SDK

Batch Serve Ad

Quickly serve or disable ads across all scenes using ReneVerse’s Batch Serve Ad system.

Previous[WIP] Using the Unity SDKNextUnreal Engine

Last updated 1 month ago

About Batch Serve Ad

The Batch Serve Ad functionality makes it easy to populate multiple ad surfaces across scenes in one go—perfect for efficient ad management at scale.

🌍 Global Registration

All ad surfaces are automatically registered globally once instantiated—no manual work required. Just place them in your scene, and the SDK takes care of the rest.

📦 How It Works

  1. Batch Request: A single request is sent to the server, asking for ad content for all registered surfaces.

  2. Even Distribution: Ads are returned and evenly assigned to all eligible ad surfaces.

  3. Gizmos in Editor: When selecting an ad surface in the editor, gizmos appear to help visualize ad placement and orientation.


🧪 Preview in Unity Editor

You can trigger batch serving directly from the editor via: Window → ReneVerse → BatchServeAd


🧑‍💻 Runtime Integration

Example 1 – Simple Scene Use:

using ReneVerse;
using UnityEngine;

public class InSceneScript : MonoBehaviour
{
    private void Awake()
    {
        ReneAPIManager.BatchServeAd();
    }
}

Example 2 – During Transition from Another Scene:

using System.Collections; 
using System.Collections.Generic; 
using UnityEngine; using UnityEngine.SceneManagement; 
using ReneVerse;

public class LoadingManagerExample : MonoBehaviour {
public string nextSceneWithAdSurfaces; 
public GameObject loadingScreen;

private void Start()
{
    StartCoroutine(LoadSceneAndBatchServeAdCoroutine());
}

private IEnumerator LoadSceneAndBatchServeAdCoroutine()
{
    // Display the loading screen
    loadingScreen.SetActive(true);

    // Load the next scene asynchronously
    AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(nextSceneWithAdSurfaces);

    // Wait until the asynchronous scene fully loads
    while (!asyncLoad.isDone)
    {
        yield return null;
    }

    // Ensure all ad surfaces are registered

    // Call the batch serve ad function asynchronously
    yield return BatchServeAdWrapper();

    // Hide the loading screen
    loadingScreen.SetActive(false);
}

private IEnumerator BatchServeAdWrapper()
{
    var task = ReneAPIManager.BatchServeAd();
    while (!task.IsCompleted)
    {
        yield return null;
    }

    if (task.Exception != null)
    {
        Debug.LogError($"BatchServeAd failed: {task.Exception}");
    }
}
}

❌ Batch Disable Ads

Need to clear ads all at once—for example, during testing? You can disable all currently served ads using:

ReneAPIManager.BatchDisableAds();

Or directly from the editor: Window → ReneVerse → BatchDisableAds

🧩
🛠️
🔨
🥞
🥞
BatchServeAd is only available in Play Mode.