We want our player to be able to return to the main menu. First, we need to add a Confirm
button to our options page. Secondly, we must play our existing tweens in reverse to make both windows go back to their initial states when the Confirm
button is clicked.
We can use our existing
Play
button as the base to create our new
Confirm
button:
Select
UI Root
|Main
|Buttons
|Play
and hit Ctrl + D to duplicate it.Rename this new duplicate to
Confirm
.Drag this new
Confirm
button inside ourUI Root
|Options
GameObject.Select our
UIRoot
|Main
GameObject and disable it.Select our
UIRoot
|Options
GameObject and enable it.
Make sure you move around your scene view to see your options page at {2000, 0, 0} so that we can see the next modifications. Now, we can transform our Play button into a real Confirm button:
Select our new
Options
|Confirm
GameObject.Set its Transform position to {0, -295, 0}.
Set Size of its
UISprite
to 520 x 130.Select its child
Label
GameObject...