Now, we want to show the options page when the Options
button is clicked. In order to do that, we will move the main menu towards the left and disable it when it's offscreen. Simultaneously, the options window will appear from the right part of the screen.
The
Tween Position
component will help us to move these windows around smoothly. It works in a way similar to that of the Tween Scale
component.
Add the
Tween Position
component to our main menu window:
In Hierarchy, select our
UI Root
|Main
GameObject.At the bottom of the Inspector view, click on the Add Component button.
Type
position
to search for components with that word.Select the Tween Position and hit Enter or click on it with your mouse.
OK, we've just added the Tween Position
component to our main menu window. I won't detail its parameters because they are exactly the same as the Tween Scale
component, except that the From and To parameters are local positions instead of local scale coordinates...