2. What is Unity
• Unity is
– A game engine and ecosystem
– Supports more platforms than any other publically available tool
– Used by hobbyists & students, up to major studios
• Unity is not
– A 2D image or vector graphic creation tool (photoshop, gimp)
– A 3D modelling environment*
• It does have a built in terrain system
• Also supports third party plugins that enable some 3D modelling (ProBuilder)
3. Features/Capabilities
• AAA Game Quality
• Editor for scene (level) assembly & in-editor game play
• Physics
• Programming with C#, JavaScript, Boo
• 2D & 3D Support
• Audio
• Particle Effects
• Animation Systems
5. Its all about the scene
• Think of a scene as a level
• Game is a collection of 1->many scenes
• Scenes are included in build
• Can have many test scenes not in final build
• Remember this icon
6. GameObjects are everything
• Near everything in a scene is a GameObject
• The System.Object of Unity
• Simply name, tag, transform
• Transform is very important
GameObject
Lights
3D Models
SpritesHUDs
Particle
Systems
7. Components make things happen
• GameObjects come to life via Components
• Includes
– MeshRenderers
– SpriteRenderers
– Audio
– Cameras
– Physics behavior
– Particle systems
– Scripts (your code)
8. Prefabs and Unity packages
• Prefabs allow reuse across (and within) scenes
– Objects will turn blue in hierarchy
• Update .prefab = update every instance in project scenes
• Unity packages allow reuse across projects
– Asset store downloads are actually .unitypackage files
– Can be imported just by double clicking
9. Unity’s Architecture
• Major Components
– Editor
– MonoDevelop
– Game Engine
• Editor
– Can play test game (play mode)
– Can extend easily
10. Project Structure
• Assets
– Always top level folder shown in Unity Editor
– Every file you bring into your project, prefabs, art, audio, and more.
• Library
– Local cache for imported assets & metadata for assets.
• ProjectSettings
– Stores settings from Edit->Project Settings
• Temp/Obj
– Used for temporary files during the build process from Mono and Unity
11. Compilation
• In the Editor
– Mono is always used to compile scripts
– Compilation in editor may be different than final build
– What works in game may be different in end build
• Your exported Visual Studio Project
– Assemblies generated by Mono or .NET
• Your game
– Compilation varies per platform. Different APIs supported.
12. Programming Model
• Game Loops are per GameObject
• Most major c# constructs, features, types valid
– Lambdas, events, LINQ, anonymous methods, classes, etc
• Do I have to code?
– No – check out PlayMaker, Behave, RainAI
13. Physics Engine
• 3D physics engine NVIDIA® PhysX® Physics
– Is it any good?
• Licensed by Unity, Unreal Engine 4, Gamebryo, Vision, Instinct, and more
• 2D physics via Box2D
– 2D physics generally much faster
– Is it any good?
• Used by Unity, GameMaker, Construct2, and more
14. The generated projects & compilation passes
Project Path Used
in
Pass
Description
Assembly-CSharp.csproj 3 All other scripts not inside folder
called Editor
Assembly-CSharp-
firstpass.csproj
1 Scripts in folders under /Assets
called Standard Assets, Pro Standard
Assets and Plugins
Assembly-CSharp-Editor-
firstpass.csproj
2 Scripts in folders called Standard
Assets/Editor, Pro Standard
Assets/Editor and Plugins/Editor
*-.vs projects n/a Can be added to Visual Studio for
editing code and debugging*
Assembly-CSharp-
Editor.csproj
4 All other scripts inside a folder call
Editor
16. What’s required?
• Initial character sketch in any art program
– Pen/ink on paper works too of course, scanned in
• Create template layer in program
– Illustrator, Inkscape, Photoshop
• Bring sketch in as base layer for reference
• Create layers for character components
• Draw components on layers piece by piece
• Drawing tablet recommended
17. Creating 3D Assets
• Create sketch/reference
• Model in Maya, Blender, 3dsMax, etc
– Create basic shapes, extrude, tweak, repeat
– Third party plugins do support basic modelling in Unity (ex ProBuilder)
• Export or bring directly into Unity
– Export to .obj or .fbx, drag/drop in Unity
– Native file format drag/drop into Unity
• Requires modelling app installed on same machine
18. 3D
• 3D is simply X,Y,Z
– X Left<->Right
– Y Up<->Down
– Z Forward<->Backwards
• Left handed coordinates
19. Rigid bodies & Colliders
• Two components for physics
• Rigidbody
– Gives your object mass
– Makes it understand gravity (optionally)
– Can exist without collider, but won’t collide
• Collider
– Defines an area to calculate collisions based on
– Can also be triggers (no physical interaction, just code is called)
– Can exist without a rigidbody (ex. a platform)
20. Vectors are just values
• Vector2D contains two values (X,Y)
– var heading = new Vector2D(10f, 8f);
– Does not represent anything but values
• Vector3D contains three values (X,Y,Z)
– var heading = new Vector2D(10f, 20f, 7.5f);
• Vectors can represent direction, values, forces
• Vectors can be relative
– Forward can be where Z is
– Forward can be where character is facing
21. Moving objects manually
• Many ways, try to move only rigidbodies
• Non-rigidbodies Unity assumes aren’t moving
22. Top Row Source: Microsoft, as of 7/31/14
Bottom Row Source: Microsoft, 7/31/13 – 7/31/14
apps
$
active users
registered
developers
MO billing partners
help drive higher
monthly revenue
YoY growth YoY growth YoY growth YoY gross sales growth
24. In-app purchases
• Full support from the publishing dashboard
– Consumables – used up and purchased again
– Durable items – can have an expiration
– Receipts – use receipts to verify purchase
• Use any 3rd-party system you want
• Cannot be offered from a trial version
25. Associate your games in both Stores
• You can associate the Windows
Store and Windows Phone
versions of your games
• This allows a one-time purchase
for the user across all platforms
• Can lead to higher usage and
engagement with your app.
26. Back button
• //Unity does this for you automatically
• <phone:PhoneApplicationPage
BackKeyPress="PhoneApplicationPage_BackKeyPress" >
• private void PhoneApplicationPage_BackKeyPress(object sender, CancelEventArgs e)
• {
• e.Cancel = UnityApp.BackButtonPressed();
• }
• //IN your unity code, handle back button, you should quit, go back or dismiss modal UI
• void Update {
• if (Input.GetKeyDown(KeyCode.Escape)){
• Application.Quit();
• }
}
27. Hardware APIs that work seamlessly
• Touch
• Microphone
• Gyro & Accelerometer
• Webcam
• Location
Hinweis der Redaktion
Also a Cloud Build Service
Gallery URL
All your assets – art, code, audio, every single file you bring into your project goes here. Only make changes here in the Unity interface, never through your file system. This is always your top level folder in the Unity Editor.
Note: Not in live session, but included for more info
Compilation phases come into play when you want to call one language from another.
These work at each phase for each language. So if you want to use JavaScript to call C#, place C# inside a folder called /Plugins so its compiled first, and JavaScript inside any generic named folder.
If you have a simple Unity project, you won’t see all of these. They only get created when you have code put into various special folders. The projects shown in Fig. Projects are broken out by only three types:
Assembly-CSharp.csproj
Assembly-CSharp-firstpass.csproj
Assembly-CSharp-Editor.csproj
For each of those projects, there’s literally a duplicate project with the name –vs on the end of it. These projects are used instead if you use Visual Studio as your code editor and they can also be added to your exported project from Unity for platform-specific debugging in your Visual Studio solution. These Visual Studio specific ones would then be
Assembly-CSharp-vs.csproj
Assembly-CSharp-firstpass-vs.csproj
Assembly-CSharp-Editor-vs.csproj
The other projects there serve the same purpose but have CSharp replaced with UnityScript. These are simply the JavaScript (UnityScript) versions of the above projects if you use JavaScript in your Unity game and only if you have your scripts in the folders that would trigger these projects to get created.
Now that we’ve seen what projects get created, let’s explorer the folders then that trigger these projects to get created and what their purposes are. Every folder path below assumes this is underneath /Assets as a root folder in your project view. Assets is always the root folder that everything is contained underneath inside of the unity Editor. For ex Standard Assets is actually /Assets/Standard Assets. The build process for your scripts runs through four phases to generate assemblies. Objects compiled in Phase 1 cannot see those in Phase 2 because they have not yet been compiled. This is important to know when you are mixing UnityScript and C# in the same project. If you want to reference a C# class from UnityScript, you’ll need to make sure it compiles in an earlier phase.
Phase 1: Runtime scripts in folders under /Assets called Standard Assets, Pro Standard Assets and Plugins. This creates the Assembly-CSharp-firstpass.csproj project.
Phase 2: Scripts in folders called Standard Assets/Editor, Pro Standard Assets/Editor and Plugins/Editor. This folder is meant for scripts that interact with the Unity Editor API for design time functionality (think of a Visual Studio plugin and how it enhances the GUI, only this runs in the Unity Editor). This creates the Assembly-CSharp-Editor-firstpass.csproj project.
Phase 3: All other scripts that are not inside a folder called Editor. This creates the Assembly-CSharp.csproj project.
Phase 4: All remaining scripts (ie, the ones that are inside any other folder called Editor, ex /Assets/Editor or /Assets/Foo/Editor). This creates the Assembly-CSharp-Editor.csproj project.
There are a couple other less used folders that aren’t covered here, like Resources. What about the pending question of what is the compiler using? Is it .NET? Is it Mono? Is it .Net for Windows Runtime? Is it .NET for Windows Phone Runtime? The following table lists the defaults of what is used for compilation. This is important to know, especially for WinRT based applications because the API available per platform varies.
Matt to add overview image (completed picture with descriptions on it)
Zombie Pumpkin Slayers
Add collider code
Key delivery point: Our market execution and reach is delivering results: growth in customers, developers, and apps. In partnership with OEMs, mobile operators and developers, we are building a healthy 3rd mobile ecosystem that is delivering real gains for partners.
Note: these numbers are the combined Windows and Windows Phone Stores.
The top row are absolute numbers showing momentum in apps, users, developers and Store sales via mobile operator billing. The second row shows percentage growth over a year ago April. The bottom row is selected, specific proof points for each of the columns, including a list of recent apps launched.
MO billing is called out because of its importance to both our developers and customers, by expanding payment options, particularly in parts of the world where credit card penetration is low. Developers make 3x more revenue on paid apps in MO billing-enabled developed markets, and up to 8x in key emerging markets such as Mexico. We’ve enabled MO billing in 36 markets to date.
Top New Apps featured: Star Wars: Tiny Death Star, Frozen Free Fall, Kincectimals Unleashed, Beats Music, Facebook Messenger, eHarmony, Bad Piggies, CNET, Alaska Airlines, Spider-Man 2
Trial is recommended for paid model. Especially with games
Maximizes download exposure and leads to higher purchase conversion
Set via the developer dashboard – managed by the platform
Time-based or feature-based
3 day trial – user will be prompted to purchase after 3 days
Limit the features in the game until the user purchases
Make it clear in the app description