# Ad Spaces

Here we cover some more engine specific details about Ad Spaces usage and what the various Ad Space configurations do.

For information on non engine specific details, see here.

# Creating Ad Spaces

# In Scene

Select GameObject > Frameplay > Ad Space to create a new Ad Space game object (with its own Activation Collider) in the active scene. The new unregistered Ad Space will display red debug text.

These options are also available when right clicking in the Hierarchy Window.

ImageImage Image

# Create a Prefab

To create an Ad Space Prefab Asset, drag an already created Ad Space GameObject from the Hierarchy Window into the Project Window. The Ad Space GameObject, and all its components and child GameObjects, becomes a new Asset in your Project Window.

If the Prefab will be loaded at runtime with multiple concurrent instances i.e. inside a procedurally generated room, set GameObjectInstanceType to Multiple (before registration in the Inspector Window).

See the Unity manual for more information on Prefabs.

# Register an Ad Space

For an Ad Space to request and display advertisements, it needs to first be registered. Please note, once an Ad Space has been registered, it cannot be unregistered. It can however be modified by using the Replace Ad Space button inside the Inspector Window.

Previous versions of a modified Ad Space will remain on the Ad Spaces Dashboard. This ensures Ad Spaces from previous build versions will receive metrics and generate revenue.

  1. Select the newly created Unregistered Ad Space Game Object from the Hierarchy or Scene Window.
  2. In the Inspector Window, scroll through the components listed to find the Frameplay Ad Space (Script).
  3. Enter a description so that the Ad Space is easily identifiable on the Ad Spaces Dashboard.
  4. Pick your preferred ratio, reposition and scale the Ad Space in the scene to your liking.
  5. Click the Register Ad Space button.

The debug text will change from red to white as the Ad Space is now registered and linked to the Frameplay servers. When activated it will download mock advertisements.

Ad Spaces cannot be registered at runtime.

ImageImage

You can register all Ad Spaces in the open Scene and register them with the Frameplay Platform at once! Assets > Frameplay > Ad Spaces > Register All In Active Scene

Image

# Inspector Configuration

To change an Ad Space's configuration, first select it in the Hierarchy Window to view configurable properties in the Inspector Window. From here you can control a whole range of features for a specific Ad Space.

For information on what each configuration does see here as they are not engine specific. Some settings (like Ad Texture Scale Multiplier) are affected by global configurations, see here.

Image

# Materials

Ad Spaces will not always have an advertisement loaded. When an advertisement is not loaded, a fully customizable Placeholder Material is displayed instead.

You can also swap out the Ad Material. The advertisement texture will be inserted into the default main texture slot of the material.

See our Best Practices Guide on how to preserve your game environment style by utilizing Placeholders.

# Pausing

Ad Space functionality can be halted. This is controlled by the public property Paused. While in the Paused state an Ad Space will not download new adverisements.

# Quality and Resolution

Each Ad Space has a quality scale multiplier that affects the displayed advertisement texture size. Setting this value to either high, medium or low determines the maximum resolution.

The scale multiplier may be changed at runtime. However, it will not increase the resolution of the currently loaded advertisement; the increase will only apply to the next downloaded advertisement.

A preview of the texture resolution that will be downloaded for an Ad Space is shown in the Tool-Tip of the Ad Texture Scale Multiplier property in the Inspector.

Quality and Resolution can also be controlled at a global level. See our Frameplay Data Asset page for more information.

Last Updated: 6/11/2020, 2:14:39 AM