SlideShare uma empresa Scribd logo
1 de 23
Roma 2014
Google DevFest
Presented by
Vincenzo Favara
vin.favara@gmail.com
www.linkedin.com/pub/vincenzo-favara/2b/117/355
www.google.com/+VincenzoFavaraPlus
Who am I?
What about?
“Unity is a game development ecosystem: a
powerful rendering engine fully integrated with a
complete set of intuitive tools and rapid workflows to
create interactive 3D and 2D content; easy
multiplatform publishing; thousands of quality,
ready-made assets in the Asset Store and a
knowledge-sharing community.”
http://unity3d.com/unity
Tell me more…
Components
- Game engine: 3D
objects, lighting,
physics, animation,
scripting
- 3D terrain editor
- 3D object animation
manager
- GUI system
- MonoDevelop:
code editor
(win/mac), Can
also use Visual
Studio (Windows)
Executable
exporter many
platforms:
Android/iOS
Pc/Mac
Ps3/Xbox
Web/flash
Unity 3D Asset Store:
There you can find all
assets you want, also
for free.
GUI
1. Scene
2. Hierarchy
3. Inspector
4. Game
5. Project
Scene & Game
The Game window shows you what
your players will see on click on Play
button.
The Scene window is where you can
position your Game Objects and
move things around. This window has
various controls to change its level of
detail.
Project & Hierarchy
It lists all of the
elements that you'll
use to create Game
Objects in your
project
The Hierarchy
panel lists all of
the Game Objects
in your Scene.
Game Objects for
example cameras,
lights, models, and
prefabs
Unity will
automatically detect
files as they are
added to your
Project folder's
Assets folder.
Inspector
The Inspector is a context-sensitive panel, which means that it
changes depending on what you select elsewhere in Unity. This
is where you can adjust the position, rotation, and scale of
Game Objects listed in the Hierarchy panel.
Game Objects can be grouped into layers, much like in
Photoshop or Flash. Unity stores a few commonly used layouts
in the Layout dropdown. You can also save and load your own
custom layouts.
1- Download “space” texture.
2- Create > Material “background”
3- Associate “space” to ”background”
4- GameObject > Create Other > Plane
5- Set -90 X plane’s rotation
6- Change shader from “diffuse” to
“background”
7- Set “background” tiling a 8,8 (X,Y)
8- Save Scene (Ctrl+s)
Start: Scene
1- GameObject > Create Empty
“SpaceInvader”
2- Set -2 Z Position
3- Create Material for “SpaceInvader “ and set
shader in Mobile > Transparent >
Vertex Color
4- GameObject > Create Other > Quad
“Spaceship” (simple plane composted by 2
triangle)
5- Associate “Spaceship” to material of
“SpaceInvader” that now it contain the quad.
Enimies
Decorator
1- Asset > Import
Package > Particles
2- Associate “Smoke Trail”
to “SpaceShip”
Let’s Script!
using UnityEngine;
using System.Collections;
public class EnemyController : MonoBehaviour
{
public float speed;
void Start () {
}
void Update () {
this.transform.position -= new Vector3(speed, 0, 0) * Time.deltaTime;
}
}
Create > C# Script “EnemyController ” and associate “EnemyControlle” to “SpaceInvader”
Prefab
- Since object-oriented instances can be INSTANTIATED at run time.
- Unity uses the term PREFAB for a pre-fabricated object template (i.e. a class combining 3D
objects and scripts)
- At DESIGN TIME (in editor) a prefab can be dragged from Project window into the Scene window
and added the scene’s hierarchy of game objects. The object can then be edited (i.e. customised
from the prefab default settings) if desired
- At RUN TIME a script can cause a new object instance to be created (instantiated) at a given
location / with a given transform set of properties
For transform a
GameObject in a
Prefab: Drag&Drop the
GameObject into a
folder “Prefabs”
created precedently in
the Project View.
1- GameObject > Create Empty “Laser” to trasform in Prefab and set -2 Z
Position
2- Create Material for Laser and set shader in Mobile > Particles/Additive
3- GameObject > Create Other > Quad “LaserBody” and associete to “Laser”
4- Associate material “Laser” to “LaserBody” and set his properties Position =
(0,0,0), Rotation = (0,0,0), Scale = (0.5, 0.05, 1).
5- Create the Script for his comportament.
Laser
using UnityEngine;
using System.Collections;
public class LaserController : MonoBehaviour{
void Start () {}
void Update () {
this.transform.position += new Vector3(10, 0, 0) * Time.deltaTime;
if (this.transform.position.x > 20.0f) {
Destroy(this.gameObject); // if not, they run to infinite
}
}
}
Let’s Script.. again!
using UnityEngine;
using System.Collections;
public class GameController : MonoBehaviour
{
public GameObject enemy;
public GameObject laser;
float spawnTimer;
void Start() {
spawnTimer = 1.0f;
}
void Update () {
spawnTimer -= Time.deltaTime;
if (spawnTimer <= 0.0f) {
GameObject instance = (GameObject) Instantiate(enemy, new Vector3(10, Random.Range(-.0f,4.0f), -
2.0f), transform.rotation);
spawnTimer = 1.0f;
}
}
}
Create > C# Script “GameController ” for they let are appare more enemies random in the
game and associate the script to Main Camera Object and the prefabs to his public variables.
using UnityEngine;
using System.Collections;
public class GameController : MonoBehaviour {
public GameObject enemy;
public GameObject laser;
float spawnTimer;
float shootTimer;
void Start () {
spawnTimer = 1.0f;
}
void Update () {
spawnTimer -= Time.deltaTime;
shootTimer -= Time.deltaTime;
if (spawnTimer <= 0.0f) {
GameObject instance = (GameObject)Instantiate(enemy,
new Vector3(10,Random.Range(-4.0f,4.0f),-2.0f), transform.rotation);
spawnTimer = 1.0f;
}
if (shootTimer <= 0.0f) {
if (Input.GetButton("Fire1")) {
Vector3 spawnLaserPos = Camera.main.ScreenToWorldPoint(
new Vector3(-5.0f, Input.mousePosition.y,8));
Instantiate(laser, spawnLaserPos, Quaternion.identity);
shootTimer = 0.4f;
}
}
}
}
1- Edit > Project Settings >
Input
2- Edit “left ctrl” to “space”
3- Edit the script “GameController ”
And again!
1- Add a new Tag in inspector of Prefabs Laser for “Laser” and Enemy for “Enemy”
2- In the Tags & Layers panel add tags Laser and Enemy and assign the Tags to the Prefabs.
4- In the Prefabs’s inspector, add a BOX COLLIDER 2D and set size(0.5, 0.05, 1)
5- Add new component on the Prefabs: Rigidbody and deflag Gravity .
Collision!
using UnityEngine;
using System.Collections;
public class EnemyController : MonoBehaviour{
public float speed;
void Start () {}
void OnCollisionEnter(Collision other) { //unity method
if (other.gameObject.tag.Equals("Laser")) {
Destroy(other.gameObject);
Destroy(this.gameObject);
Instantiate(explosion, this.transform.position, this.transform.rotation);
}
}
void Update () {
this.transform.position -= new Vector3(speed, 0, 0) * Time.deltaTime;
}
}
1- GameObject > Create Empty “Explosion” to trasform in Prefab
2- Edit Script “EnemyController ” for the Collision and Explosion
3- Associate prefab “Explosion” to “SpaceInvader” Prefab
Script…again!
When: Enemies touch left boorder line.
1- File > New Scene “GameOver”
2- GameObject > Create other > GUI Text and set
Position (0.5,0.5,0).
3- Set black the Main Camera background
4- Return with duble click to gameScene, File gt;
Build Settings: for add the scene GameOver to the
project
5- Add the two scenes with Add Current
GAME OVER
using UnityEngine;
using System.Collections;
public class EnemyController : MonoBehaviour{
public float speed;
void Start () {}
void OnCollisionEnter(Collision other) { //unity method
if (other.gameObject.tag.Equals("Laser")) {
Destroy(other.gameObject);
Destroy(this.gameObject);
Instantiate(explosion, this.transform.position, this.transform.rotation);
}
}
void Update () {
this.transform.position -= new Vector3(speed, 0, 0) * Time.deltaTime;
if (this.transform.position.x <= -10.0f) {
GameOver();
}
}
void GameOver(){ Application.LoadLevel(1); } //change scene
}
Script…again!
using UnityEngine;
using System.Collections;
public class GameOverController : MonoBehaviour{
float gameOverTimer;
void Start () {
gameOverTimer = 5.0f;
}
void Update () {
gameOverTimer -= Time.deltaTime;
if(gameOverTimer <= 0.0f)
Application.LoadLevel(0);
}
}
Return to Game!
Create > C# Script “GameOverController ” and associate the script to GameOver Scene’s
Main Camera
“It will work”!
“Could it work”?
The Impossible is
the first step towards
possible
(cit. by me)

Mais conteúdo relacionado

Mais procurados

Creating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Creating Asha Games: Game Pausing, Orientation, Sensors and GesturesCreating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Creating Asha Games: Game Pausing, Orientation, Sensors and GesturesJussi Pohjolainen
 
Building a turn-based game prototype using ECS - Unite Copenhagen 2019
Building a turn-based game prototype using ECS - Unite Copenhagen 2019Building a turn-based game prototype using ECS - Unite Copenhagen 2019
Building a turn-based game prototype using ECS - Unite Copenhagen 2019Unity Technologies
 
Locally run a FIWARE Lab Instance In another Hypervisors
Locally run a FIWARE Lab Instance In another HypervisorsLocally run a FIWARE Lab Instance In another Hypervisors
Locally run a FIWARE Lab Instance In another HypervisorsJosé Ignacio Carretero Guarde
 
We Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle Games
We Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle GamesWe Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle Games
We Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle GamesUnity Technologies
 
The Ring programming language version 1.5.2 book - Part 49 of 181
The Ring programming language version 1.5.2 book - Part 49 of 181The Ring programming language version 1.5.2 book - Part 49 of 181
The Ring programming language version 1.5.2 book - Part 49 of 181Mahmoud Samir Fayed
 
Converting Scene Data to DOTS – Unite Copenhagen 2019
Converting Scene Data to DOTS – Unite Copenhagen 2019Converting Scene Data to DOTS – Unite Copenhagen 2019
Converting Scene Data to DOTS – Unite Copenhagen 2019Unity Technologies
 
The Ring programming language version 1.8 book - Part 56 of 202
The Ring programming language version 1.8 book - Part 56 of 202The Ring programming language version 1.8 book - Part 56 of 202
The Ring programming language version 1.8 book - Part 56 of 202Mahmoud Samir Fayed
 
UIImageView vs Metal [日本語版] #tryswiftconf
UIImageView vs Metal [日本語版] #tryswiftconfUIImageView vs Metal [日本語版] #tryswiftconf
UIImageView vs Metal [日本語版] #tryswiftconfShuichi Tsutsumi
 
The Ring programming language version 1.6 book - Part 52 of 189
The Ring programming language version 1.6 book - Part 52 of 189The Ring programming language version 1.6 book - Part 52 of 189
The Ring programming language version 1.6 book - Part 52 of 189Mahmoud Samir Fayed
 
Cross platform game development
Cross platform game developmentCross platform game development
Cross platform game developmentJerel Hass
 
The Ring programming language version 1.5.1 book - Part 48 of 180
The Ring programming language version 1.5.1 book - Part 48 of 180The Ring programming language version 1.5.1 book - Part 48 of 180
The Ring programming language version 1.5.1 book - Part 48 of 180Mahmoud Samir Fayed
 
3D Computer Graphics with Python
3D Computer Graphics with Python3D Computer Graphics with Python
3D Computer Graphics with PythonMartin Christen
 
Enhance your world with ARKit. UA Mobile 2017.
Enhance your world with ARKit. UA Mobile 2017.Enhance your world with ARKit. UA Mobile 2017.
Enhance your world with ARKit. UA Mobile 2017.UA Mobile
 
Snapshot clone-boot-presentation-final
Snapshot clone-boot-presentation-finalSnapshot clone-boot-presentation-final
Snapshot clone-boot-presentation-finalOpen Stack
 
How I hacked the Google Daydream controller
How I hacked the Google Daydream controllerHow I hacked the Google Daydream controller
How I hacked the Google Daydream controllerMatteo Pisani
 
Custom SRP and graphics workflows - Unite Copenhagen 2019
Custom SRP and graphics workflows - Unite Copenhagen 2019Custom SRP and graphics workflows - Unite Copenhagen 2019
Custom SRP and graphics workflows - Unite Copenhagen 2019Unity Technologies
 

Mais procurados (20)

Sequence diagrams
Sequence diagramsSequence diagrams
Sequence diagrams
 
Creating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Creating Asha Games: Game Pausing, Orientation, Sensors and GesturesCreating Asha Games: Game Pausing, Orientation, Sensors and Gestures
Creating Asha Games: Game Pausing, Orientation, Sensors and Gestures
 
Building a turn-based game prototype using ECS - Unite Copenhagen 2019
Building a turn-based game prototype using ECS - Unite Copenhagen 2019Building a turn-based game prototype using ECS - Unite Copenhagen 2019
Building a turn-based game prototype using ECS - Unite Copenhagen 2019
 
libGDX: Tiled Maps
libGDX: Tiled MapslibGDX: Tiled Maps
libGDX: Tiled Maps
 
Locally run a FIWARE Lab Instance In another Hypervisors
Locally run a FIWARE Lab Instance In another HypervisorsLocally run a FIWARE Lab Instance In another Hypervisors
Locally run a FIWARE Lab Instance In another Hypervisors
 
We Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle Games
We Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle GamesWe Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle Games
We Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle Games
 
The Ring programming language version 1.5.2 book - Part 49 of 181
The Ring programming language version 1.5.2 book - Part 49 of 181The Ring programming language version 1.5.2 book - Part 49 of 181
The Ring programming language version 1.5.2 book - Part 49 of 181
 
Converting Scene Data to DOTS – Unite Copenhagen 2019
Converting Scene Data to DOTS – Unite Copenhagen 2019Converting Scene Data to DOTS – Unite Copenhagen 2019
Converting Scene Data to DOTS – Unite Copenhagen 2019
 
Game dev 101 part 3
Game dev 101 part 3Game dev 101 part 3
Game dev 101 part 3
 
Intro to Asha UI
Intro to Asha UIIntro to Asha UI
Intro to Asha UI
 
The Ring programming language version 1.8 book - Part 56 of 202
The Ring programming language version 1.8 book - Part 56 of 202The Ring programming language version 1.8 book - Part 56 of 202
The Ring programming language version 1.8 book - Part 56 of 202
 
UIImageView vs Metal [日本語版] #tryswiftconf
UIImageView vs Metal [日本語版] #tryswiftconfUIImageView vs Metal [日本語版] #tryswiftconf
UIImageView vs Metal [日本語版] #tryswiftconf
 
The Ring programming language version 1.6 book - Part 52 of 189
The Ring programming language version 1.6 book - Part 52 of 189The Ring programming language version 1.6 book - Part 52 of 189
The Ring programming language version 1.6 book - Part 52 of 189
 
Cross platform game development
Cross platform game developmentCross platform game development
Cross platform game development
 
The Ring programming language version 1.5.1 book - Part 48 of 180
The Ring programming language version 1.5.1 book - Part 48 of 180The Ring programming language version 1.5.1 book - Part 48 of 180
The Ring programming language version 1.5.1 book - Part 48 of 180
 
3D Computer Graphics with Python
3D Computer Graphics with Python3D Computer Graphics with Python
3D Computer Graphics with Python
 
Enhance your world with ARKit. UA Mobile 2017.
Enhance your world with ARKit. UA Mobile 2017.Enhance your world with ARKit. UA Mobile 2017.
Enhance your world with ARKit. UA Mobile 2017.
 
Snapshot clone-boot-presentation-final
Snapshot clone-boot-presentation-finalSnapshot clone-boot-presentation-final
Snapshot clone-boot-presentation-final
 
How I hacked the Google Daydream controller
How I hacked the Google Daydream controllerHow I hacked the Google Daydream controller
How I hacked the Google Daydream controller
 
Custom SRP and graphics workflows - Unite Copenhagen 2019
Custom SRP and graphics workflows - Unite Copenhagen 2019Custom SRP and graphics workflows - Unite Copenhagen 2019
Custom SRP and graphics workflows - Unite Copenhagen 2019
 

Semelhante a Unity3 d devfest-2014

School For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine BasicsSchool For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine BasicsNick Pruehs
 
Academy PRO: Unity 3D. Environment
Academy PRO: Unity 3D. EnvironmentAcademy PRO: Unity 3D. Environment
Academy PRO: Unity 3D. EnvironmentBinary Studio
 
Getting started with Verold and Three.js
Getting started with Verold and Three.jsGetting started with Verold and Three.js
Getting started with Verold and Three.jsVerold
 
38199728 multi-player-tutorial
38199728 multi-player-tutorial38199728 multi-player-tutorial
38199728 multi-player-tutorialalfrecaay
 
Tools for developing Android Games
 Tools for developing Android Games Tools for developing Android Games
Tools for developing Android GamesPlatty Soft
 
Fps tutorial 2
Fps tutorial 2Fps tutorial 2
Fps tutorial 2unityshare
 
Gdc09 Minigames
Gdc09 MinigamesGdc09 Minigames
Gdc09 MinigamesSusan Gold
 
Useful Tools for Making Video Games - XNA (2008)
Useful Tools for Making Video Games - XNA (2008)Useful Tools for Making Video Games - XNA (2008)
Useful Tools for Making Video Games - XNA (2008)Korhan Bircan
 
Android game development
Android game developmentAndroid game development
Android game developmentdmontagni
 
ARCore 101: A Hands-on Workshop
ARCore 101: A Hands-on WorkshopARCore 101: A Hands-on Workshop
ARCore 101: A Hands-on WorkshopUnity Technologies
 
Augmented World Expo 2013 Mobile AR SDK Comparison and Tutorial
Augmented World Expo 2013 Mobile AR SDK Comparison and TutorialAugmented World Expo 2013 Mobile AR SDK Comparison and Tutorial
Augmented World Expo 2013 Mobile AR SDK Comparison and TutorialPatrick O'Shaughnessey
 
How tomakea gameinunity3d
How tomakea gameinunity3dHow tomakea gameinunity3d
How tomakea gameinunity3dDao Tung
 
Game development with Cocos2d
Game development with Cocos2dGame development with Cocos2d
Game development with Cocos2dVinsol
 
From Hello World to the Interactive Web with Three.js: Workshop at FutureJS 2014
From Hello World to the Interactive Web with Three.js: Workshop at FutureJS 2014From Hello World to the Interactive Web with Three.js: Workshop at FutureJS 2014
From Hello World to the Interactive Web with Three.js: Workshop at FutureJS 2014Verold
 
Testing a 2D Platformer with Spock
Testing a 2D Platformer with SpockTesting a 2D Platformer with Spock
Testing a 2D Platformer with SpockAlexander Tarlinder
 
React Native custom components
React Native custom componentsReact Native custom components
React Native custom componentsJeremy Grancher
 
IntroToEngineDevelopment.pdf
IntroToEngineDevelopment.pdfIntroToEngineDevelopment.pdf
IntroToEngineDevelopment.pdfzakest1
 
C++ game development with oxygine
C++ game development with oxygineC++ game development with oxygine
C++ game development with oxyginecorehard_by
 

Semelhante a Unity3 d devfest-2014 (20)

School For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine BasicsSchool For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine Basics
 
Academy PRO: Unity 3D. Environment
Academy PRO: Unity 3D. EnvironmentAcademy PRO: Unity 3D. Environment
Academy PRO: Unity 3D. Environment
 
Getting started with Verold and Three.js
Getting started with Verold and Three.jsGetting started with Verold and Three.js
Getting started with Verold and Three.js
 
38199728 multi-player-tutorial
38199728 multi-player-tutorial38199728 multi-player-tutorial
38199728 multi-player-tutorial
 
Unity workshop
Unity workshopUnity workshop
Unity workshop
 
Unity3D Programming
Unity3D ProgrammingUnity3D Programming
Unity3D Programming
 
Tools for developing Android Games
 Tools for developing Android Games Tools for developing Android Games
Tools for developing Android Games
 
Fps tutorial 2
Fps tutorial 2Fps tutorial 2
Fps tutorial 2
 
Gdc09 Minigames
Gdc09 MinigamesGdc09 Minigames
Gdc09 Minigames
 
Useful Tools for Making Video Games - XNA (2008)
Useful Tools for Making Video Games - XNA (2008)Useful Tools for Making Video Games - XNA (2008)
Useful Tools for Making Video Games - XNA (2008)
 
Android game development
Android game developmentAndroid game development
Android game development
 
ARCore 101: A Hands-on Workshop
ARCore 101: A Hands-on WorkshopARCore 101: A Hands-on Workshop
ARCore 101: A Hands-on Workshop
 
Augmented World Expo 2013 Mobile AR SDK Comparison and Tutorial
Augmented World Expo 2013 Mobile AR SDK Comparison and TutorialAugmented World Expo 2013 Mobile AR SDK Comparison and Tutorial
Augmented World Expo 2013 Mobile AR SDK Comparison and Tutorial
 
How tomakea gameinunity3d
How tomakea gameinunity3dHow tomakea gameinunity3d
How tomakea gameinunity3d
 
Game development with Cocos2d
Game development with Cocos2dGame development with Cocos2d
Game development with Cocos2d
 
From Hello World to the Interactive Web with Three.js: Workshop at FutureJS 2014
From Hello World to the Interactive Web with Three.js: Workshop at FutureJS 2014From Hello World to the Interactive Web with Three.js: Workshop at FutureJS 2014
From Hello World to the Interactive Web with Three.js: Workshop at FutureJS 2014
 
Testing a 2D Platformer with Spock
Testing a 2D Platformer with SpockTesting a 2D Platformer with Spock
Testing a 2D Platformer with Spock
 
React Native custom components
React Native custom componentsReact Native custom components
React Native custom components
 
IntroToEngineDevelopment.pdf
IntroToEngineDevelopment.pdfIntroToEngineDevelopment.pdf
IntroToEngineDevelopment.pdf
 
C++ game development with oxygine
C++ game development with oxygineC++ game development with oxygine
C++ game development with oxygine
 

Último

Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 

Último (20)

Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 

Unity3 d devfest-2014

  • 3. What about? “Unity is a game development ecosystem: a powerful rendering engine fully integrated with a complete set of intuitive tools and rapid workflows to create interactive 3D and 2D content; easy multiplatform publishing; thousands of quality, ready-made assets in the Asset Store and a knowledge-sharing community.” http://unity3d.com/unity
  • 4. Tell me more… Components - Game engine: 3D objects, lighting, physics, animation, scripting - 3D terrain editor - 3D object animation manager - GUI system - MonoDevelop: code editor (win/mac), Can also use Visual Studio (Windows) Executable exporter many platforms: Android/iOS Pc/Mac Ps3/Xbox Web/flash Unity 3D Asset Store: There you can find all assets you want, also for free.
  • 5. GUI 1. Scene 2. Hierarchy 3. Inspector 4. Game 5. Project
  • 6. Scene & Game The Game window shows you what your players will see on click on Play button. The Scene window is where you can position your Game Objects and move things around. This window has various controls to change its level of detail.
  • 7. Project & Hierarchy It lists all of the elements that you'll use to create Game Objects in your project The Hierarchy panel lists all of the Game Objects in your Scene. Game Objects for example cameras, lights, models, and prefabs Unity will automatically detect files as they are added to your Project folder's Assets folder.
  • 8. Inspector The Inspector is a context-sensitive panel, which means that it changes depending on what you select elsewhere in Unity. This is where you can adjust the position, rotation, and scale of Game Objects listed in the Hierarchy panel. Game Objects can be grouped into layers, much like in Photoshop or Flash. Unity stores a few commonly used layouts in the Layout dropdown. You can also save and load your own custom layouts.
  • 9. 1- Download “space” texture. 2- Create > Material “background” 3- Associate “space” to ”background” 4- GameObject > Create Other > Plane 5- Set -90 X plane’s rotation 6- Change shader from “diffuse” to “background” 7- Set “background” tiling a 8,8 (X,Y) 8- Save Scene (Ctrl+s) Start: Scene
  • 10. 1- GameObject > Create Empty “SpaceInvader” 2- Set -2 Z Position 3- Create Material for “SpaceInvader “ and set shader in Mobile > Transparent > Vertex Color 4- GameObject > Create Other > Quad “Spaceship” (simple plane composted by 2 triangle) 5- Associate “Spaceship” to material of “SpaceInvader” that now it contain the quad. Enimies
  • 11. Decorator 1- Asset > Import Package > Particles 2- Associate “Smoke Trail” to “SpaceShip”
  • 12. Let’s Script! using UnityEngine; using System.Collections; public class EnemyController : MonoBehaviour { public float speed; void Start () { } void Update () { this.transform.position -= new Vector3(speed, 0, 0) * Time.deltaTime; } } Create > C# Script “EnemyController ” and associate “EnemyControlle” to “SpaceInvader”
  • 13. Prefab - Since object-oriented instances can be INSTANTIATED at run time. - Unity uses the term PREFAB for a pre-fabricated object template (i.e. a class combining 3D objects and scripts) - At DESIGN TIME (in editor) a prefab can be dragged from Project window into the Scene window and added the scene’s hierarchy of game objects. The object can then be edited (i.e. customised from the prefab default settings) if desired - At RUN TIME a script can cause a new object instance to be created (instantiated) at a given location / with a given transform set of properties For transform a GameObject in a Prefab: Drag&Drop the GameObject into a folder “Prefabs” created precedently in the Project View.
  • 14. 1- GameObject > Create Empty “Laser” to trasform in Prefab and set -2 Z Position 2- Create Material for Laser and set shader in Mobile > Particles/Additive 3- GameObject > Create Other > Quad “LaserBody” and associete to “Laser” 4- Associate material “Laser” to “LaserBody” and set his properties Position = (0,0,0), Rotation = (0,0,0), Scale = (0.5, 0.05, 1). 5- Create the Script for his comportament. Laser using UnityEngine; using System.Collections; public class LaserController : MonoBehaviour{ void Start () {} void Update () { this.transform.position += new Vector3(10, 0, 0) * Time.deltaTime; if (this.transform.position.x > 20.0f) { Destroy(this.gameObject); // if not, they run to infinite } } }
  • 15. Let’s Script.. again! using UnityEngine; using System.Collections; public class GameController : MonoBehaviour { public GameObject enemy; public GameObject laser; float spawnTimer; void Start() { spawnTimer = 1.0f; } void Update () { spawnTimer -= Time.deltaTime; if (spawnTimer <= 0.0f) { GameObject instance = (GameObject) Instantiate(enemy, new Vector3(10, Random.Range(-.0f,4.0f), - 2.0f), transform.rotation); spawnTimer = 1.0f; } } } Create > C# Script “GameController ” for they let are appare more enemies random in the game and associate the script to Main Camera Object and the prefabs to his public variables.
  • 16. using UnityEngine; using System.Collections; public class GameController : MonoBehaviour { public GameObject enemy; public GameObject laser; float spawnTimer; float shootTimer; void Start () { spawnTimer = 1.0f; } void Update () { spawnTimer -= Time.deltaTime; shootTimer -= Time.deltaTime; if (spawnTimer <= 0.0f) { GameObject instance = (GameObject)Instantiate(enemy, new Vector3(10,Random.Range(-4.0f,4.0f),-2.0f), transform.rotation); spawnTimer = 1.0f; } if (shootTimer <= 0.0f) { if (Input.GetButton("Fire1")) { Vector3 spawnLaserPos = Camera.main.ScreenToWorldPoint( new Vector3(-5.0f, Input.mousePosition.y,8)); Instantiate(laser, spawnLaserPos, Quaternion.identity); shootTimer = 0.4f; } } } } 1- Edit > Project Settings > Input 2- Edit “left ctrl” to “space” 3- Edit the script “GameController ” And again!
  • 17. 1- Add a new Tag in inspector of Prefabs Laser for “Laser” and Enemy for “Enemy” 2- In the Tags & Layers panel add tags Laser and Enemy and assign the Tags to the Prefabs. 4- In the Prefabs’s inspector, add a BOX COLLIDER 2D and set size(0.5, 0.05, 1) 5- Add new component on the Prefabs: Rigidbody and deflag Gravity . Collision!
  • 18. using UnityEngine; using System.Collections; public class EnemyController : MonoBehaviour{ public float speed; void Start () {} void OnCollisionEnter(Collision other) { //unity method if (other.gameObject.tag.Equals("Laser")) { Destroy(other.gameObject); Destroy(this.gameObject); Instantiate(explosion, this.transform.position, this.transform.rotation); } } void Update () { this.transform.position -= new Vector3(speed, 0, 0) * Time.deltaTime; } } 1- GameObject > Create Empty “Explosion” to trasform in Prefab 2- Edit Script “EnemyController ” for the Collision and Explosion 3- Associate prefab “Explosion” to “SpaceInvader” Prefab Script…again!
  • 19. When: Enemies touch left boorder line. 1- File > New Scene “GameOver” 2- GameObject > Create other > GUI Text and set Position (0.5,0.5,0). 3- Set black the Main Camera background 4- Return with duble click to gameScene, File gt; Build Settings: for add the scene GameOver to the project 5- Add the two scenes with Add Current GAME OVER
  • 20. using UnityEngine; using System.Collections; public class EnemyController : MonoBehaviour{ public float speed; void Start () {} void OnCollisionEnter(Collision other) { //unity method if (other.gameObject.tag.Equals("Laser")) { Destroy(other.gameObject); Destroy(this.gameObject); Instantiate(explosion, this.transform.position, this.transform.rotation); } } void Update () { this.transform.position -= new Vector3(speed, 0, 0) * Time.deltaTime; if (this.transform.position.x <= -10.0f) { GameOver(); } } void GameOver(){ Application.LoadLevel(1); } //change scene } Script…again!
  • 21. using UnityEngine; using System.Collections; public class GameOverController : MonoBehaviour{ float gameOverTimer; void Start () { gameOverTimer = 5.0f; } void Update () { gameOverTimer -= Time.deltaTime; if(gameOverTimer <= 0.0f) Application.LoadLevel(0); } } Return to Game! Create > C# Script “GameOverController ” and associate the script to GameOver Scene’s Main Camera
  • 23. The Impossible is the first step towards possible (cit. by me)