• Tutorials
  • Releases
  • API Reference
  • Login

›Admix Unity SDK API Reference

Admix Unity SDK API Reference

  • Introduction to the Admix Unity Plugin API
  • Placements Queue Management Events
  • Placement Load Events
  • Gaze Events and Other Event Types

Placements Queue Management Events

Starting with the SDK2.0 this functionality is deprecated.

Currently, all ads are loaded into placements sequentially. During the scene load, all placements are placed in an ads loading queue which defines the sequence of ads loading. There are two major events for the ads queue:

  • ManagerEvents.PlacementLoadSuccess.OnQueueOccupied - Triggered when an item is added to the queue. May be executed several times (for example, in case of using deferred placement game object activation).
  • ManagerEvents.PlacementLoadSuccess.OnQueueEmpty - Triggered when the queue becomes empty. May be executed several times.

Defining Actions for the Admix SDK Events Through the Unity Object Inspector UI

You can use serialised event fields in the object’s inspector to set up actions for all supported events.

You can set up Queue events in the AdmixManager object inspector window:

api queue and gaze events.png

Defining Actions for the Admix SDK Events Through the SDK API

Placements Queue Management Events Code Example

Manager Queue Events: AdmixQueueEvents.cs

advirManager class

public ManagerEventStruct ManagerEvents;

C#
using Unity.Engine;
using Admix.AdmixCore;

public class AdmixQueueEvents : MonoBehaviour
{
private void Start()
{
// Adding QueueOccupied method as listener to OnQueueOccupied UnityEvent.
AdmixPreferences.Instance.FindExistingManager().ManagerEvents.QueueOccupied.OnQueueOccupied.AddListener(QueueOccupied);
// Adding QueueEmpty method as listener to OnQueueEmpty UnityEvent.
AdmixPreferences.Instance.FindExistingManager().ManagerEvents.QueueIsEmpty.OnQueueEmpty.AddListener(QueueEmpty);
}

/// <summary>
/// Test listener
/// </summary>
/// <param name="arg0">Placements left to process count.</param>
private void QueueOccupied(int arg0)
{
Debug.Log("Queue occupied.\n" + arg0 + " items left.");
}

/// <summary>
/// Test listener
/// </summary>
/// <param name="arg0">Placements left to process count.</param>
private void QueueEmpty(int arg0)
{
Debug.Log("Queue is empty.\n" + arg0 + " items left. e.g. disabled placements");
}
}
← Introduction to the Admix Unity Plugin APIPlacement Load Events →
  • Defining Actions for the Admix SDK Events Through the Unity Object Inspector UI
  • Defining Actions for the Admix SDK Events Through the SDK API
    • Placements Queue Management Events Code Example
Documentation
TutorialsReleasesAPI Reference
Admix
Admix HomepageLogin
Copyright © 2021 Admix