Unity For Software Engineers
Unity For Software Engineers
Geraldo Nascimento
Plumbee 2014
Introduction
Unity is a Game Engine
In constant development, multitude of
plugins available on the Asset Store
Before official 2D support, alternative was a
mix of frameworks and workarounds
Unity
Built with Mono
UnityEditor is built with (mostly) the same C#
API used to make games in Unity
Output to Web (plugin), iOS, Android
and soon WebGL
Unity
IL2CPP: an AOT compiler and VM
Their own implementation of the CLI
Claim 2x, 3x performance uptick over their
usage of Mono
Not about recreating .NET or Mono
toolchain, will still use Mono C# compiler
GameObject
Components
RigidBody
(Physics)
Properties
Transform
(Position, Size, etc)
MonoBehaviour
(Scripts)
Movement
x, y, z
scaleX, scaleY, scaleZ
Daub
isDaubed
Prefab
ExampleMonoBehaviour.cs
void Start()
void Update()
void OnDisable()
Basic Workflow
Drag and Drop assets into
Scene, creating GameObjects
Specialize GameObjects with
Components
Set properties on Components
Problematic for teams larger
than 2
Design Patterns
MVVM
Model - C# class
View Model - MonoBehaviour
View - GameObject
Design Patterns
Dependency Injection
To avoid using GameObject.Find or static classes
Already a number of frameworks:
StrangeIoC
Zenject
Art Integration
High artist input is encouraged
Artists can work with Unity on a daily basis, design the
UI and tinker
They dont need an engineer to build the game, so they
can test their changes themselves
UI System
Official Unity UI recently released
Visual design driven
Artists and designers can implement their
designs directly
Animations
Unit Tests
Compatible with any C# unit testing frameworks
UnityUnitTesting: open source package to visualize unit test
results within the Unity Editor
MonoBehaviours are impossible to test (they cant be
instantiated) - Solution: separate logic from MBs
UnityTestTools allows testing GameObjects within live
scenes
Facebook
Facebook worked together with Unity to
solve security concerns of logging into
Facebook through Unity
Facebook officially branded WebPlayer
installation flow
Native Plugins
Similar flow to AIRs native extensions:
build native functionality in Objective-C, Java
Prime31: one of the top Unity native plugins
suppliers, theyve made Purchases,
Facebook and others
Conclusion
Impetus to use Unity is speeding up our game
development process
Speed up asset integration by allowing artists to work
directly on the project
Speed up game prototyping and testing of ideas (ex:
prototype a new feature in a day, then spend a couple of
weeks implementing)
Conclusion
Although heavily oriented by visual design, there are
solutions to allow higher degree of visibility and control
of the project to engineers
Posit: faster art integration, more time for engineers to
work on new features, optimization
Viability for Mobile is proven, Web is still to be seen
License
Unity Pro
iOS Pro
Android Pro
Total
One-off per
version (4.x, 5x)
1500$
per developer
1500$
per developer
1500$
per developer
4500$
per developer
Subscription
75$
per month
per developer
75$
per month
per developer
75$
per month
per developer
225$
per month
per developer
Reference
IL2CPP: http://blogs.unity3d.com/2014/05/20/the-future-of-scripting-in-unity/
Design Patterns for Unity:
https://docs.google.com/document/d/
1Kja6ZSBaG0Fl4WyBklPSUDLmjCo8jilDGkhW3dOxF2c/pub
Samurai Siege:
http://www.pocketgamer.biz/asia/feature/59222/clash-of-alliances-the-makingof-samurai-siege/
http://www.gamasutra.com/view/pressreleases/217015/
SAMURAI_SIEGE_SURPASSES_12_MILLION_REVENUE_IN_FIRST_SIXMO
NTHS.php
Reference
Unit & Integration Testing
https://github.com/catburton/UnityUnitTesting
http://blogs.unity3d.com/2013/12/18/unity-test-tools-released/
http://blogs.unity3d.com/2014/06/03/unit-testing-part-2-unit-testingmonobehaviours/
New UI System
http://blogs.unity3d.com/2014/05/28/overview-of-the-new-ui-system/
Jenkins plugin: https://github.com/jenkinsci/unity3d-plugin