SlideShare a Scribd company logo
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)

More Related Content

What's hot

Sequence diagrams
Sequence diagramsSequence diagrams
Sequence diagrams
Alfonso Torres
 
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
Jussi 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 2019
Unity Technologies
 
libGDX: Tiled Maps
libGDX: Tiled MapslibGDX: Tiled Maps
libGDX: Tiled Maps
Jussi Pohjolainen
 
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
José 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 Games
Unity 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 181
Mahmoud 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 2019
Unity Technologies
 
Game dev 101 part 3
Game dev 101 part 3Game dev 101 part 3
Game dev 101 part 3
Christoffer Noring
 
Intro to Asha UI
Intro to Asha UIIntro to Asha UI
Intro to Asha UI
Jussi Pohjolainen
 
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
Mahmoud Samir Fayed
 
UIImageView vs Metal [日本語版] #tryswiftconf
UIImageView vs Metal [日本語版] #tryswiftconfUIImageView vs Metal [日本語版] #tryswiftconf
UIImageView vs Metal [日本語版] #tryswiftconf
Shuichi 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 189
Mahmoud Samir Fayed
 
Cross platform game development
Cross platform game developmentCross platform game development
Cross platform game development
Jerel 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 180
Mahmoud Samir Fayed
 
3D Computer Graphics with Python
3D Computer Graphics with Python3D Computer Graphics with Python
3D Computer Graphics with Python
Martin 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-final
Open 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 controller
Matteo 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 2019
Unity Technologies
 

What's hot (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
 

Similar to 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 Basics
Nick Pruehs
 
Academy PRO: Unity 3D. Environment
Academy PRO: Unity 3D. EnvironmentAcademy PRO: Unity 3D. Environment
Academy PRO: Unity 3D. Environment
Binary 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.js
Verold
 
38199728 multi-player-tutorial
38199728 multi-player-tutorial38199728 multi-player-tutorial
38199728 multi-player-tutorial
alfrecaay
 
Unity workshop
Unity workshopUnity workshop
Unity workshop
fsxflyer789Productio
 
Unity3D Programming
Unity3D ProgrammingUnity3D Programming
Unity3D Programming
Michael Ivanov
 
Tools for developing Android Games
 Tools for developing Android Games Tools for developing Android Games
Tools for developing Android Games
Platty Soft
 
Fps tutorial 2
Fps tutorial 2Fps tutorial 2
Fps tutorial 2
unityshare
 
Gdc09 Minigames
Gdc09 MinigamesGdc09 Minigames
Gdc09 Minigames
Susan 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 development
dmontagni
 
ARCore 101: A Hands-on Workshop
ARCore 101: A Hands-on WorkshopARCore 101: A Hands-on Workshop
ARCore 101: A Hands-on Workshop
Unity 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 Tutorial
Patrick O'Shaughnessey
 
How tomakea gameinunity3d
How tomakea gameinunity3dHow tomakea gameinunity3d
How tomakea gameinunity3d
Dao Tung
 
Game development with Cocos2d
Game development with Cocos2dGame development with Cocos2d
Game development with Cocos2d
Vinsol
 
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
Verold
 
Testing a 2D Platformer with Spock
Testing a 2D Platformer with SpockTesting a 2D Platformer with Spock
Testing a 2D Platformer with Spock
Alexander Tarlinder
 
React Native custom components
React Native custom componentsReact Native custom components
React Native custom components
Jeremy Grancher
 
IntroToEngineDevelopment.pdf
IntroToEngineDevelopment.pdfIntroToEngineDevelopment.pdf
IntroToEngineDevelopment.pdf
zakest1
 
C++ game development with oxygine
C++ game development with oxygineC++ game development with oxygine
C++ game development with oxygine
corehard_by
 

Similar to 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
 

Recently uploaded

Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 

Recently uploaded (20)

Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 

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)