Sometimes, UI elements require some kind of interaction with the player. This recipe, along with the previous and the following ones, will teach you how to create interactive panels. Furthermore, we will see how to make a panel resizable. For instance, the player will be able to resize the panel by dragging one of its corners. This is useful when the UI is full of panels and windows and we want to let the player choose their dimension to suit his needs. To do this, we will use the Event Trigger (Script) component and develop a script to handle the interaction.
First, we can create a panel by right-clicking on the Hierarchy panel and then clicking on the UI | Panel. Rename it to ResizablePanel. We should also resize it so that we can see the entire panel on the screen.
We need to create another panel inside the first one. To do this, right-click on ResizablePanel in the Hierarchy panel and then choose UI | Panel. We should rename it as ResizeArea in order...