Skip to Content
Unity 2017 Mobile Game Development
book

Unity 2017 Mobile Game Development

by John P. Doran
November 2017
Beginner to intermediate content levelBeginner to intermediate
360 pages
6h 40m
English
Packt Publishing
Content preview from Unity 2017 Mobile Game Development

Displaying a simple Ad

As mentioned previously, Unity Ads has two different types of ads that we can display: simple and rewarded. Simple ads are easy to use, hence the name, and allow users to have simple full-screen interstitial ads. This can be really useful for moving between levels or perhaps for when the player wants to restart the game. Let's see how we can implement that feature now.

  1. To get started, it would be a good idea for us to have all of the Ad-related behavior to share a script, so we will create a new class called UnityAdController by going to the Project window, opening the Assets/Scripts folder, and selecting Create | C# Script.
  2. Open up the file in the IDE of your choice, and use the following code:
using UnityEngine; ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Holistic Mobile Game Development with Unity

Holistic Mobile Game Development with Unity

Penny de Byl
Hands-On Unity 2020 Game Development

Hands-On Unity 2020 Game Development

Nicolas Alejandro Borromeo

Publisher Resources

ISBN: 9781787288713Supplemental Content