Minicurso - Unity3D
Semana Aberta de Informática
(2016)
Curso Introdutório
-
Conceitos básicos
-
Interface
-
Scripts
Conceitos básicos
-
GameObject
-
Atributos
-
Transform
-
Renderer
-
-
Cenas
-
Assets

Interface

File

Utilitários
-
Edit: Configurações de desenvolvimento
-
Assets: Bibliotecas e arquivos externos
-
GameObject: GameObjects "prontos"
-
Componnents: Atributos
-
Window
-
Asset Store
-
Macros & Maneabilidade
-
F : Focaliza um objeto em cena
-
del : Deleta um item da cena ou assets
-
F2 : Renomeia
-
Right click + Mouse move : Gira a camera no editor
-
Middle Click + Mouse move : Move a camera do editor no eixo x e y
-
ctrl + Move Object : Move objetos em "escala" (1 em 1)
Scripts
- Javascript ou C#
- São atributos
- API do Unity3D
- Métodos sobrecarregados
- Muito vasta
Start e Update
#pragma strict
function Start () {
}
function Update () {
}
Time.deltaTime
#pragma strict
var relogio : float;
function Start () {
relogio = 0;
}
function Update () {
relogio+=Time.deltaTime;
}
Colisões
#pragma strict
function Start() {
}
function OnCollisionEnter(collision: Collision) {
Destroy(collision.transform.gameObject);
}
- OnCollisionStay
- OnCollisionLeave
- OnTriggerEnter
- ...
transform
e
gameObject
#pragma strict
function Start() {
}
function Update() {
/*
transform e gameObject se referem ao transform e gameObject que contém este
script.
Obs: gameObject != GameObject
*/
transform.position.z+=10*Time.deltaTime;
gameObject.transform.Rotate(0,20*Time.deltaTime,0);
}
Input
#pragma strict
function Start() {
}
function Update() {
if(Input.GetKey("w")
transform.Translate(Vector3.forward);
if(Input.GetKey(Keycode.Space)
pular();
if(Input.GetAxis("Mouse X"))
print("Mecheu o mouse");
}
Obrigado!


Unity3D
By Bruno Henrique Meyer
Unity3D
- 961