UFCFS3-30-13D Technologies for the Web Unity 3D: Review of Topics and Related Concepts.

Slides:



Advertisements
Similar presentations
Working with Tables for Page Design – Lesson 41 Working with Tables for Page Design Lesson 4.
Advertisements

The Librarian Web Page Carol Wolf CS396X. Create new controller  To create a new controller that can manage more than just books, type ruby script/generate.
UFCFSU-30-13D Technologies for the Web Creating and Updating a Graphical Heads-Up Display (HUD)
INNER WORKINGS OF UNITY 3D. WHAT WE ARE GOING TO COVER Intro to Unity Physics & Game Objects Cameras & Lighting Textures & Materials Quaternions and Rotation.
UFCFSU-30-13D Technologies for the Web Creating and Using GUI Components.
GameCamp! and Game Davis Creating a 2D Platformer in Unity.
Create slices and hotspots Create links in Web pages Create rollovers from slices Create basic animation Add tweening symbol instances to create animation.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
HELLO WORLD: YOUR FIRST PROGRAM CHAPTER Topics  Hello World?  Creating a Unity Project –The Unity Project Folder  MonoDevelop: Unity's Code Editor.
FIRST COURSE Creating Web Pages with Microsoft Office 2007.
Tutorial 3: Adding and Formatting Text. 2 Objectives Session 3.1 Type text into a page Copy text from a document and paste it into a page Check for spelling.
UFCEKU-20-3Web Games Programming Unity 3D Physics Colliders and Object Collisions.
Java Programming, 3e Concepts and Techniques Chapter 3 Section 65 – Manipulating Data Using Methods – Java Applet.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 4 1 Microsoft Office FrontPage 2003 Tutorial 4 – Using Shared Borders and Themes.
Advanced Level Course. Site Extras Site Extras consist of four categories: Stationeries Site Trash Designs Components.
UFCEKU-20-3Web Games Programming Unity 3D Basic Concepts Using and Creating Prefabs.
EEC-693/793 Applied Computer Vision with Depth Cameras Lecture 13 Wenbing Zhao
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
LiveCycle Data Services Introduction Part 2. Part 2? This is the second in our series on LiveCycle Data Services. If you missed our first presentation,
Using the Netbeans GUI Builder. The Netbeans IDE provides a utility called the GUI Builder that assists you with creating Windows applications. The Netbeans.
Domain 3 Understanding the Adobe Dreamweaver CS5 Interface.
© 2010 Delmar, Cengage Learning Chapter 8 Collecting Data with Forms.
Web Games Programming An Introduction to Unity 3D.
Chapter 8 Collecting Data with Forms. Chapter 8 Lessons Introduction 1.Plan and create a form 2.Edit and format a form 3.Work with form objects 4.Test.
Web Games Programming Unity Scripting Fundamentals.
Chapter 5 Quick Links Slide 2 Performance Objectives Understanding Framesets and Frames Creating Framesets and Frames Selecting Framesets and Frames Using.
Learning Unity. Getting Unity
SE 320 – Introduction to Game Development Lecture 3: Unity’s Interface and Concepts Lecturer: Gazihan Alankuş Please look at the last two slides for assignments.
UFCFS D Technologies for the Web Unity Interface Features.
SE 320 – Introduction to Game Development Lecture 7: Programming Lecturer: Gazihan Alankuş Please look at the last two slides for assignments (marked with.
Yingcai Xiao Game Development with Unity3D. Outline IDE Engine Assets Tutorial Examples Inside.
Yingcai Xiao Game Development Intro to Unreal Engine.
UFCEK-20-3Web Games Programming Unity 3D: Review of Topics Publishing for the Web.
Creating a Dynamic Web Page Template Module 5: Beyond the Basics with Expression Web LESSON 10.
Unity GUI Creating and Using GUI Components. Agenda GUI Components GUI Layout Using Styles and Skins for Design ‘Look and Feel’ Scripting GUI Communication.
Problem Solving Methodology Rachel Gauci. Problem Solving Methodology Development Design Analysis Evaluation Solution requirements and constraints. Scope.
Derived from Kirill Muzykov’s Rocket Mouse Tutorial WakeUpAndCode.com.
Creating a Java Application and Applet
GameDevClub CODE CHEAT SHEET NOTE: ALL OF THE CODE IS CASE-SENSITIVE AND THE SYNTAX IS STRICT SO A LOT OF YOUR ERRORS WILL PROBABLY COME FROM TYPOS If.
UFCEKU-20-3Web Games Programming Instantiating World Objects.
UFCFSU-30-13D Technologies for the Web An Introduction to Unity 3D.
Expressive Intelligence Studio // Center for Games and Playable Media // Unity Pro John Murray Expressive.
INTRO TO UNITY Building your first 3D game. DISCLAIMER  “This website is not affiliated with, maintained, endorsed or sponsored by Unity Technologies.
Yingcai Xiao Game Development with Unity3D Inside/Outside Unity3D.
Angry Teapots– using the physics engine in Unity Peter Passmore.
UFCEKU-20-3Web Games Programming Creating and Updating a Graphical Heads-Up Display (HUD)
Game Development with Unity3D
Welcome! Day1, Lesson 1.
EEC-693/793 Applied Computer Vision with Depth Cameras
Quick Intro to Unity Lecture 2.
Game Development with Unity3D Inside/Outside Unity3D
3D Technologies for the Web
3GB3 Game Design Unity 3D Basics.
More (C#) Scripting Day 2, Lesson 1.
EEC-693/793 Applied Computer Vision with Depth Cameras
Web Games Programming Creating Split-View Cameras and Camera Overlays.
ICT & Statistics Center
Character Selection from a lobby in Unity
EEC-693/793 Applied Computer Vision with Depth Cameras
Chapter 2 Adding Web Pages, Links, and Images
lecture 8 Our First Project
Simple Windows Applications
Tutorial 6 Creating Dynamic Pages
A Prime Example of HCI Application
Week 6: Time and triggers!
Using Templates and Library Items
Fundaments of Game Design
EEC-693/793 Applied Computer Vision with Depth Cameras
Unity Game Development
Presentation transcript:

UFCFS D Technologies for the Web Unity 3D: Review of Topics and Related Concepts

UFCFS D Technologies for the Web Review Topics Scripting Physics and Collision Detection Prefabs Spawning Objects Camera Overlays Heads-Up Displays Publishing

UFCFS D Technologies for the Web Scripting

UFCFS D Technologies for the Web Changing an Object’s Properties via Scripts Cube Object // fragment void Update () { if(Input.GetKeyDown(KeyCode.R)){ gameObject.renderer.material.color = Color.red; } ColourSwitcher.cs

UFCFS D Technologies for the Web Inter-Script Communication TransmitReceive Transmit.cs Code to send message to Receive.cs attached to cube object Receive.cs Code to handle message sent by Transmit.cs. attached to sphere object Sphere Cube

UFCFS D Technologies for the Web Debug Utility Function Very useful debug and environment events utility function Debug.Log (“Message you to want to send to the Console Window”); Debug.Log("I have received " + numberOfMessages + ” messages from the transmit script");

UFCFS D Technologies for the Web Physics and Collision Detection

UFCFS D Technologies for the Web Example Colliders: Box Cube Box Collider

UFCFS D Technologies for the Web Example Colliders: Models Box on MeshCapsule on MeshMesh on Mesh

UFCFS D Technologies for the Web Using Colliders as ‘Colliders’ The default setting for any collider attached to an object is to restrict the object being passed through be other world objects. The collision event must be handled by a script attached to one or both of the objects involved in the collision ObjectCollisons.cs Code to handle collisions

UFCFS D Technologies for the Web Handling Events Initiated by Collisions This script is attached to the First Person Controller (Capsule Collider) void OnControllerColliderHit(hit:ControllerColliderHit){ if (hit.collider == GameObject.Find("RedSphere").collider){ Debug.Log("I've hit the Red Sphere"); }; if (hit.collider == GameObject.Find("BlueSphere").collider){ Debug.Log("I've hit the Blue Sphere"); }; Unity has a built in method for detecting collisions:

UFCFS D Technologies for the Web Using Colliders as ‘Triggers’ Object collisions may be used to generate events ‘triggers’ which can be used to update logic in the World, generate actions, instantiate (create) new objects or remove unwanted objects from the world. Using triggers is one way for the player to collect items that update values via attached scripts. ObjectTriggers.cs Code to handle collisions as event triggers. Objects defined as triggers can be ‘passed through’ by other objects

UFCFS D Technologies for the Web Tag Names and the Tag Manager To reference objects in the collision function each object must have a name (Tag) defined via the Tag Manager The tag name used in any script reference must exactly match the tag name defined in the Tag Manager So RedSphere is not the same as redSphere

UFCFS D Technologies for the Web Handling Events Initiated by Triggers This script is attached to the First Person Controller (Capsule Collider) void OnTriggerEnter(collisionInfo:Collider){ if(collisionInfo.gameObject.tag == "RedSphere"){ Debug.Log("I've gone through the Red Sphere!"); } if(collisionInfo.gameObject.tag == "BlueSphere"){ Debug.Log("I've deleted the Blue Sphere!"); Destroy(collisionInfo.gameObject); } Unity has a built in method for detecting collisions as triggers:

UFCFS D Technologies for the Web Prefabs

UFCFS D Technologies for the Web Camera Mesh Audio Listener The First Person Controller is a prefabricated object FPS.js Code to handle FPS Walker etc. Mesh collider Scripts

UFCFS D Technologies for the Web Creating Prefabs In order to create a Prefab, simply drag a object that you've created in the scene into the Project View. The object's name will turn blue to show that it is a Prefab, then rename your new Prefab The object and all its ‘children’ have been copied into the Prefab data The Prefab can now be re-used in multiple instances The original object in the Hierarchy has now become an ‘instance’ of the new Prefab.

UFCFS D Technologies for the Web Creating a Simple Prefab (Receive) Receive Receive.cs Code to handle message sent by Transmit.cs attached to sphere object Prefab created from the Receive cube by attaching a script.

UFCFS D Technologies for the Web Spawning Objects

UFCFS D Technologies for the Web Instantiate Command The Instantiate command has three parameters (arguments) Object to create, position to create it, rotation to give it: Instantiate(object,object’s position,object’s rotation);

UFCFS D Technologies for the Web Instantiate Command Position and Rotation of objects to be instantiated must be specified as Vector3 values (X,Y,Z) used as follows: GameObject aPrefab; // variable of type GameObject Instantiate(aPrefab, Vector3(0,12,30), Vector3(0,0,90));

UFCFS D Technologies for the Web Dummy Object Positioned in Scene at (0, 2, 5)

UFCFS D Technologies for the Web Dummy Object Mesh Render Switched Off

UFCFS D Technologies for the Web Camera Overlays

UFCFS D Technologies for the Web Split - Viewport Camera Layouts

UFCFS D Technologies for the Web Vertical Split-Screen x 0, y 0 Height (0.5) Width (1) Viewport

UFCFS D Technologies for the Web Creating Camera Overlays

UFCFS D Technologies for the Web Camera Depth Order cameraOne depth order = 0 cameraTwo depth order = 1 result

UFCFS D Technologies for the Web Adjust Depth - in the Inspector Window

UFCFS D Technologies for the Web Overlay and Scaling Scaled camera window overlay on main camera could be used as a follow overhead camera to aid character navigation in the world

UFCFS D Technologies for the Web Heads-Up Displays (HUDS)

UFCFS D Technologies for the Web Steps Required to Establish a HUD Acquire or create art work in an appropriate format Import the HUD artwork via Asset- Import New Asset Create a GUI Texture Game Object and associate the artwork with the texture object Position the HUD components in the interface Create scripts which initialize and update the HUD based on world states and events Attach scripts to objects that change world state and trigger events which update values in the appropriate HUD script

UFCFS D Technologies for the Web HUD Declaration and Initialization public variables associated with textures

UFCFS D Technologies for the Web Updating the HUD via Scripts (BatteryCollect.js) // static variable is accessible by other scripts i.e. its // variable scope is global public int charge; Texture2D charge1tex; Texture2D charge2tex; Texture2D charge3tex; Texture2D charge4tex; Texture2D charge0tex; // initialise GUI texture to false (don't display it) void Start(){ guiTexture.enabled = false; charge = 0; } This script is attached to the GUI Texture GameObject

UFCFS D Technologies for the Web /* the Update method checks status of charge variable which is increased via an external script each time the player collides (collects) with a battery */ void Update () { /* first battery collected assign the first texture image to guiTexture and enable (display) texture */ if(charge == 1){ guiTexture.texture = charge1tex; guiTexture.enabled = true; } // display subsequent textures to indicate power collected else if(charge == 2){ guiTexture.texture = charge2tex; } // etc. Updating the HUD via Scripts

UFCFS D Technologies for the Web Updating the HUD via Scripts (PlayerCollisions.js) void Start () { } void Update () { } public void OnTriggerEnter(Collider collisionInfo){ if(collisionInfo.gameObject.tag == "battery"){ BatteryCollect.charge++; Destroy(collisionInfo.gameObject); } This script is attached to the First Person Controller

UFCFS D Technologies for the Web Publishing for the Web

UFCFS D Technologies for the Web Choose File – Build Settings… 1. Choose Web Player 2. Add Current Scene 3. Choose Build

UFCFS D Technologies for the Web Check Colour and Layout of HTML Page Unity will create a default html page for your web player and save them both to a common folder with the name you chose after selecting build. You will need to edit the file to remove unwanted text, provide an appropriate html page title, adjust layout, and change page background colour.

UFCFS D Technologies for the Web Publish to your UWE Student Module Homepage and make sure to test everything is working. Ask a fellow student to access your page from their account to ensure file permissions are correctly set. Publish and Test!