This repository was archived by the owner on Aug 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
UnityAdsHelper Button
Nikkolai Davenport edited this page Jun 10, 2016
·
3 revisions
In this section, we'll create and configure a Unity UI Button for use with this example.
Step 1: Start by creating a new Unity UI Button in your scene. Creating a new UI Button will also add a UI Canvas and EventSystem to your scene if they don't already exist.
- Select GameObject > UI > Button from the Unity Editor menu.
- Press the T key to switch to using the Rect Transform Tool.
- Select and drag the UI Button to the center of the UI Canvas.
Step 2: Customize the UI Button for use with this example.
- Rename the new UI Button to ShowAdButton.
- Expand ShowAdButton in the Hierarchy to view child objects.
- Locate and select the GameObject named Text.
- Rename the Text GameObject to ReadyText.
- Enter "Show Default Ad" into the Text field of the Text component.
Step 3: Create a non-interactable version of the button text.
- Locate and select the GameObject named ReadyText.
- Select Edit > Duplicate to create a duplicate GameObject.
- Rename the duplicate GameObject to WaitingText.
- Enter "Waiting..." into the Text field of the the Text component.
- Disable the Text component of the GameObject for the time being.
Step 4: Configure the UI Canvas to scale with screen size.
- Locate and select the GameObject named Canvas.
- Set the UI Scale Mode of the Canvas Scaler to Scale With Screen Size.
- Set the Match value to 0.5 between Width and Height.
Note: Be sure to check out the Unity UI system Tutorials and Docs to learn more.