Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Criando UI no Unity | Interface e Sons no Unity
Unity para Iniciantes
course content

Conteúdo do Curso

Unity para Iniciantes

Unity para Iniciantes

1. Introdução ao Unity
2. Escreva seu Primeiro Script
3. Física no Unity
4. Interface e Sons no Unity
5. Polindo e Exportando seu Jogo

book
Criando UI no Unity

Choose the type of UI element you want to add (e.g., Button, Text, Image) from the "UI" menu.

This will add the selected UI element as a child of the Canvas in the scene.(it will create a canvas if it doesn't exist)

Use the Scene view to position and size the UI elements as desired.

You can click and drag UI elements to move them around and use the handles on the corners and edges to resize them.

With the UI element selected in the Hierarchy window, you can customize its properties in the Inspector window. Adjust properties such as text content, color, font size, image sprite, and others to customize the appearance of the UI element.

To make UI elements interactive, you can add event listeners and scripts. Select the UI element you want to add interactivity to. In the Inspector window, click on the "Add Component" button and add a script that handles user input (e.g., Button onClick events).

Next let's make something happen when we click on the button. First click on the plus button.

Next click on the player and drag and drop it there on the object filed.

Next, click on the arrow next to "No function":

Since we want the player to restart their position, we need to click on the playerMVT and select the RestartLevel() function.

This means when the player click on the button we will restart the level.

Which Unity component acts as a container for UI elements?

Which Unity component acts as a container for UI elements?

Selecione a resposta correta

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 4. Capítulo 2
We're sorry to hear that something went wrong. What happened?
some-alt