Game Development with Unity 3 D InsideOutside Unity

  • Slides: 36
Download presentation
Game Development with Unity 3 D Inside/Outside Unity 3 D Yingcai Xiao

Game Development with Unity 3 D Inside/Outside Unity 3 D Yingcai Xiao

Unity 3 D Engine IDE Assets Tutorial Examples

Unity 3 D Engine IDE Assets Tutorial Examples

Installation Download at https: //education. github. com/pack Unity. com/ Supporting multi-platforms.

Installation Download at https: //education. github. com/pack Unity. com/ Supporting multi-platforms.

Unity 3 D: Create Project • Create your first Unity 3 D project.

Unity 3 D: Create Project • Create your first Unity 3 D project.

Getting started with a simple Unity 3 D project Start Unity 3 D Basic

Getting started with a simple Unity 3 D project Start Unity 3 D Basic Components: Game Objects, Prefabs, Physics and Scripting File->New Project (3 D or 2 D) File->Save Scene

Getting started with a simple Unity 3 D project Assets->Import Packages - Cameras -

Getting started with a simple Unity 3 D project Assets->Import Packages - Cameras - Characters - Effects - Environment - Particle. Systems - Utility - Vehicles

Object Creation Game. Object->3 D object->sphere Edit->Frame Select (to show the created object) Hold

Object Creation Game. Object->3 D object->sphere Edit->Frame Select (to show the created object) Hold onto the arrows to move the sphere or change the position in the Inspector. Note: Y is up.

Inspector and transform panel Moving, translation, rotation and scaling tools

Inspector and transform panel Moving, translation, rotation and scaling tools

Unity 3 D: Component Select the created Game Object, then Component->Physics->Rigidbody • Rigid Objects:

Unity 3 D: Component Select the created Game Object, then Component->Physics->Rigidbody • Rigid Objects: non-deformable with physical properties (gravity, inertial). • Non-rigid Objects: • Deformable: changeable geometry • Breakable: changeable topology. • Intangible Objects: No predefined shape. fire, clouds, …

Animation Window>Animation Click on the object to be animated. Component>Miscellaneous>Animation

Animation Window>Animation Click on the object to be animated. Component>Miscellaneous>Animation

Animation In the Animation window: Create New Animation Clip Click on the record button

Animation In the Animation window: Create New Animation Clip Click on the record button (red) at the top-left. Save the new animation clip file. Click on Curves. Select Add Property->Transform (click on the arrow) position,

Animation Click on the top of the timeline to start a new key point.

Animation Click on the top of the timeline to start a new key point. Move the object in the Scene up. Click on the top of the timeline to start another key point. Move the object in the Scene to the right. Now click on the play button in the Animation window.

Animation Add key frame on the timeline as many as you want. Click on

Animation Add key frame on the timeline as many as you want. Click on the red button again to finish making the animation clip.

Animation (Unity 5) You can switch from the default “Dopesheet” view to “Curves” view

Animation (Unity 5) You can switch from the default “Dopesheet” view to “Curves” view and drag the curves to modify the animation.

Animation Go back to Unity window. Under Inspector Animation , change the name of

Animation Go back to Unity window. Under Inspector Animation , change the name of animation clip from none to the one that you have made.

Play Animation Back to the Unity Main Window. Click on the play button. What

Play Animation Back to the Unity Main Window. Click on the play button. What happened? The object dropped out after the animation. Go to the Inspector, remove the “Rigid Body” component. Play again.

Animation Event Allows you to call functions in the object’s script at specified points

Animation Event Allows you to call functions in the object’s script at specified points in the timeline. Add a new Animation Event by doubleclicking the Event Line or by using the Event button.

Animation Event When you add an event, a dialog box will appear to prompt

Animation Event When you add an event, a dialog box will appear to prompt you for the name of the function and the value of the parameter you want to pass to it.

Unity 3 D: Light • Game Object ->Light -> Directional Light (Default) • Move

Unity 3 D: Light • Game Object ->Light -> Directional Light (Default) • Move and rotate just like any other object.

Terrain • Game. Object 3 D Object Terrain • In the hierarchy panel, select

Terrain • Game. Object 3 D Object Terrain • In the hierarchy panel, select Terrain. • In the Inspector: set position x = -5, y = 0, z = -5. • Click on one of the action icons in Terrain (Script) to raise/lower terrain, paint height, smooth height, paint texture, place trees, paint details, terrain setting. Adjust brush size to 1 before performing the operations.

Terrain • Assets->Import Package->Environment • In Inspector of the Terrain • Select Brush Texture

Terrain • Assets->Import Package->Environment • In Inspector of the Terrain • Select Brush Texture • Edit Texture • In the “Add Terrain Texture” Window, click on “Select” • Select Grass. Frond in the “Select Texture 2 D” window • Click on “Add” in the “Add Terrain Texture” Window

Trees There are two ways to place trees: creat individual trees brush forests Create

Trees There are two ways to place trees: creat individual trees brush forests Create an individual tree Game Object->3 D object ->Tree In the Inspector, add brunches and leaves

Trees Brushing forests: In Hierarchy, select the terrain object. In Inspector->Edit Trees -> Add

Trees Brushing forests: In Hierarchy, select the terrain object. In Inspector->Edit Trees -> Add Trees In Add Trees popup window, click on the little circle at the right-most of the “Tree Prefab” row. Select, say, Palm and then click on “Add” Go back to Inspector, in Terrian area, click on “Place Trees” button Brush trees in the Scene window.

Physics Unity 3 D provide Physics library. - Rigidbody, collider, joint, force and etc.

Physics Unity 3 D provide Physics library. - Rigidbody, collider, joint, force and etc. Rigidbody component : gravity automatically added Collision detection : box, sphere, capsule , mesh, and terrain. Collision call back function : On. Collision. Enter, On. Collision and On. Collision. Exit.

Player (for a third-person game) • Make sure to save the scene “File->Save Scene”

Player (for a third-person game) • Make sure to save the scene “File->Save Scene” (Ctrl S”) and save the project “File->Save Project” • Assets->Import Package->Characters • In the Project window, drag “Assets->Standard Assets->Characters->3 rd Person Character->Prefabs>3 rd. Person. Controller. ” to the Hierarchy window or directly into the Scene. • In the Hierarchy window, double-click on the 3 rd Person Controller. • Click on the “Move selected object” icon. Then move the controller to the top of the terrain. You may have to adjust your view angle by clicking on the ‘xyz” icon to see the position. Click the middle of the icon to get the perspective view.

Unity 3 D: Play • Now click on the “Play” icon and use the

Unity 3 D: Play • Now click on the “Play” icon and use the arrow keys to controll the player. • You should see the player running around and make sure he does not run off the edge.

Unity 3 D: Build • File->Build Setting • Can build games for more than

Unity 3 D: Build • File->Build Setting • Can build games for more than ten platforms (including Windows, i. OS, Linux, Web. GL, almost all game consoles. ) • Web. GL: https: //docs. unity 3 d. com/Manual/webgl-building. html

Under the Hood

Under the Hood

Unity 3 D IDE: Integrated Development Environment Project: directory and files for a specific

Unity 3 D IDE: Integrated Development Environment Project: directory and files for a specific game project. C: UsersxiaoDocumentsNew Unity Project 1 Assets (anything you can reuse) Library (binary files)

Unity 3 D: Assets C: UsersxiaoDocumentsNew Unity Project 1Assets (anything you can reuse) Standard

Unity 3 D: Assets C: UsersxiaoDocumentsNew Unity Project 1Assets (anything you can reuse) Standard Assets Open. NI Scripts _Scenes Materials Artwork

Unity 3 D: Standard Assets C: UsersxiaoDocumentsNew Unity Project 1AssetsStandard Assets Objects: (Look) Tree

Unity 3 D: Standard Assets C: UsersxiaoDocumentsNew Unity Project 1AssetsStandard Assets Objects: (Look) Tree Terrain Charater Lights: (Look) Light Flares Light Cookies Code: (Feel: control, interaction, animation, …) Scripts

Unity 3 D: Objects C: UsersxiaoDocumentsNew Unity Project 1AssetsStandard AssetsCharater: Prefab: (Predefined Objects) First

Unity 3 D: Objects C: UsersxiaoDocumentsNew Unity Project 1AssetsStandard AssetsCharater: Prefab: (Predefined Objects) First Person, 3 rd Person Source: Prototype (Look) Constructor. FBX Materials (properties) Textures (images) Scripts (Feel: actions) Java Scripts: Third. Person. Controller. js C#: Mouse. Look. cs

Unity 3 D: Scripts Languages: Interpreted : Java Script (no more) Compiled: C# Usages:

Unity 3 D: Scripts Languages: Interpreted : Java Script (no more) Compiled: C# Usages: General: under ProjectScripts Exit. On. Escape. cs Objects: attached to objects Third. Person. Controller. js

Unity 3 D: Library cache: for speeding up processing metadata: data that describes data

Unity 3 D: Library cache: for speeding up processing metadata: data that describes data previews: for previewing scenes Script. Assemblies: compiled object assemblies for scripts

Resources for 3 D model http: //www. turbosquid. com Blender http: //www. blender. org

Resources for 3 D model http: //www. turbosquid. com Blender http: //www. blender. org Autodesk Maya http: //www. autodesk. com/products/autode sk-maya/overview

Unity • A popular game engine • An IDE for developing application of interactive

Unity • A popular game engine • An IDE for developing application of interactive animations. • Support drag-and-drop visual programming • Abundant importable assets. • Can be built for many game systems.