Error notification
We want the user to enter a nickname in the input field and select a power before he or she can launch the game.
Right now, the user can launch the game regardless of the input and selected power value. Let's correct this by preventing the game's launch and notifying the user, as shown in the following screenshot:
We will use a TweenScale through code that will gradually scale up the notification from {0, 0, 0} to {1, 1, 1} by following these steps:
Select our Tooltip GameObject in the Hierarchy window.
Duplicate it with Ctrl + D.
Rename this new duplicate as
Notification
and perform the following steps:Set its Depth parameter in UIPanel to 5.
Remove its UITooltip component.
Set its Transform position to {
0
,-355
,0
}.
Select our Label GameObject in
Notification
and perform the following steps:Change its text to
This is a Notification
.Set the Overflow parameter to Shrink Content.
Set its Pivot parameter to Center (middle button + middle button).
Set its Dimensions to
550
x80
.Reset...