This document summarizes key aspects of game development using Unity 5. It discusses Unity's 2D and 3D support, physics engines, animation systems, visual scripting with Visual Studio Tools for Unity, and implementing core game elements like lighting, audio, user input, and user interface. Mobile and desktop platforms are supported across a wide range of device families through Windows 10 builds.
2. • Full 2D & 3D support
• Terrain building & SpeedTree support
• Physics
– Nvidia Physx3 & Box2D
• Over 22 platforms supported
• Real time GI & Physically based shaders
• Mechanim Animation system
• Asset Store
Major Components
3. • Use Visual Studio to edit & debug code
• Integrates VS with Unity
• Provides
– Shader syntax highlighting
– Code templates
– Intellisense
– Full debugging support
– Better debug visualization
Visual Studio Tools for Unity
VSTU
4. • Start with one
• Blueprint of your game
• Living document, provides reference point
• Some prefer a single page
• Describes game play, mechanics, story line, and more
• Easy to get lost without one
Game Design Document
5. Standard Shader
• Why another shader?
• Two types – default (metallic), specular is other
• You can customize the shader
– Source available
• All new materials use it by default
• Caution when importing models
– Legacy textures may be set
6.
7. New Skybox
• Skybox is a material, with a skybox shader
– 6-Sided
– Cube Map
– Procedural
• HDRI Support (High Dynamic Range Image)
• Can dynamically control properties
8. Lighting
• 4 types of lights
– Directional, point, spot, area
• Lighting is expensive
• What’s baking?
10. Reflection Probes
• A tool for creating high-quality, localized reflections.
• Captures surround environment on sphere, reprojects as
cubemap on relflective objects.
• Place as needed through scene, smaller high-detailed objects up
close.
• Blend Probes and Box projection for hallways type
environments.
• Lightmap static
11. Animation
• Unity supports two animation systems
– Legacy
– Mechanim – Uses .ani file and animation controllers
• New features targeted at Mechanim
– AnimationStateBehaviors
– No more:
• animator.GetCurrentAnimatorStateInfo(0).isName(“Attack")
• 2D Root Motion
• Can use API to create animation controllers
12. Zombie Animations
• New AnimationStateBehaviors
• New Any State & Exit State
Entry
Idle
Any State Exit
Walk
Died
13. Audio
• Previously, all audio played through single AudioSource
• No control over various levels, mixing, controlling groups
• New mixer allows precise control, signal routing, effects
• Can edit in play mode
• Unity supports custom plugins
– http://docs.unity3d.com/Manual/AudioMixerNativeAudioPlugin.html
• Profiler supports audio
14. Coin pickup
• Typical process is check trigger, increment score
• A PlayerScore component tracks score
• Simply a variable to track inventory
• Challenges of UI / Rotation
15. Zombie Score
• Get references to player score
• If we hit the player, tell someone about it.
– Some will check on the player for a hit
16. Enabling Mobile Input
• Input system reads values (button, keys, controller, arrows)
• Input.GetButtonDown(“Fire1”)
– Works on Mobile for touch only!
• Input.GetAxis(“Horizontal”) works with keyboard
– Doesn’t work on mobile (no keyboard)
• Solution – track image position on screen and read virtual values
• Third party assets like EasyTouch
• Code exists in CrossPlatformInput
17. Perspective
• Default Camera Mode
• Viewing area defined by field of view
• Clipping planes define min and max viewing distance
18. Orthographic
• Common for 2D
• Further away objects = same size
• orthographicSize is how many units = ½ height
• Fixed height, width variable by aspect ratio
19. Unity UI
• Allows placement of one or more Canvas game objects
• Can overlay or project from other areas onto screen
• Allows for scaling, pixel perfect, even measurement based
drawing
• Text & Image components + script form bulk of UI components
• Based off NGUI initially, completely separate though
20. Canvas
• Various canvas modes
• UI Elements MUST be in a canvas
• Event system detects actions to send to components in canvas
• Three modes
21. The RectTransform
• Critical portion of Unity UI, used instead of Transform for UI
• Defines
– location, rotation
– Defines anchors for positioning, pivot for rotation, and size
22. Enhancing the game
• Pickup text
• Other effects
• Particles
– Optimized system
– Can include animations and physics
23. Phone Small
Tablet
2-in-1s
(Tablet or Laptop)
Desktops
& All-in-Ones
Phablet Large
Tablet
Classic
Laptop
Xbox IoTSurface Hub
Windows 10 powers a huge range of hardware…
Holographic
24. • Windows 10 supports device families
• Will ship with Mobile and Desktop families
• Additional will come
– Xbox, HoloLens, etc.
• Multiple builds still work
• Can use Asset Bundles to dynamically load assets
• Requires Unity 5.2 (currently in private beta)
The Build