# Ad Spaces
Here we cover Ad Spaces and their configurations in Unity.
For more information on Ad Spaces and best practices see our Developer Guidelines.
# Creating Ad Spaces
Here we go through the different methods of creating an Ad Space.
# In a Scene
- Select GameObject > Frameplay > Ad Space to create a new Ad Space Game Object in the active scene.
- Pick your preferred ratio
- Reposition and scale the Ad Space to fit the Scene.
- Select your own Placeholder Material to display before an advertisement is loaded. See our Developer Guide for best practices.
The new Ad Space will display red debug text, this shows that it is not currently registered.
# In a Prefab
Ad Spaces can also be created in a Prefab Stage by using the same GameObject menu.
To convert an Ad Space in a Scene to a Prefab Asset, drag the Ad Space GameObject (in the Scene) from the Hierarchy Window, and drop into the Project Window.
# Register an Ad Space
For an Ad Space to request and display advertisements, it needs to be registered.
- Select the new Unregistered Ad Space Game Object from the Hierarchy or Scene Window.
- In the Inspector Window, scroll through the components list to find the Frameplay Ad Space (Script).
- Enter a description so that the Ad Space is easily identifiable on the Ad Spaces Dashboard.
- 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.
# Replace an Ad Space
To modify a Registered Ad Space, select the Replace Ad Space button, make any required changes, then re-register the Ad Space.
This will ensure previous registered versions will remain on the Ad Spaces Dashboard and continue to generate revenue if they are still active in older builds of your game.
# Register All Ad Spaces
You can register all Ad Spaces in the open Scene at once by selecting Assets > Frameplay > Ad Spaces > Register All In Active Scene
# Inspector Configuration
Select an Ad Space in the Hierarchy or Scene Window to view it's configurable properties.
A description field to easily identify the Ad Space in the current Scene.
Ad Spaces will not always have an advertisement loaded. When an advertisement is not loaded, a fully customizable Placeholder Material is displayed instead. Drag a custom material into this slot to provide your own Placeholder:
Ad Spaces can be set to remain invisible when an advertisement is not loaded by using
Place Holder Visible During Play.
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.
# 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.
The Paused property is a Boolean value that will halt Ad Space functionality. While paused, the Ad Space will not download any new advertisements.
# Ad Loaded Event
The time taken for an advertisement to load is dependent on the users internet connection speed.
On Ad Loaded is a
UnityEvent that is fired once an advertisement has been loaded on the Ad Space.
# Synchronized Ad Space List
This is a list of Synchronized Ad Spaces linked in the open Scene or Stage.
In Edit Mode you can "Create New" Synchronized Ad Spaces, and "Refresh List" after any changes.
This list is re-populated at runtime. When a Synchronized Ad Space is spawned it will register with it's parent Ad Space.
Easily find the linked Synchronized Ad Spaces by double clicking the item in the list, this will highlight the Game Object in the Scene Window.