Lecture 11
Lecture 11
Unity Project
◦ Introduction to basic Graphical components (objects)
◦ 2D / 3D graphics
2D Game Development in Unity
◦ Sprites and Sprite Renderer
◦ Creating a basic scene
◦ Animations
◦ Layers
When creating a project in Unity, it's possible to set up the editor for
2D Mode:
Pixels to Units denes the number of pixels from the sprite that will
correspond to 1 unit in world space.
Pivot determines the position of the pivot in the sprite. The pivot is the point
in the image where the sprite's local coordinate system originates.
It is possible to organize your game objects in layers. Layers are
used:
◦ by cameras to render only a part of the screen.
◦ by raycasting to selectively ignore colliders.
◦ by Lights to illuminate the scene.
◦ to determine collisions (Layer-based Collision).
◦ to determine the order in which sprites are rendered.
To assign a game object to a layer, simply select the layer at the top
of the Inspector View, with the game object selected:
Unity provides some layers by default, but you can create new
layers in Edit > Project Settings > Tags and Layers.
It is possible to specify, for both camera and light
components, which layers will be affected by these (Culling
Mask selector). By default, all layers are rendered by the
camera and illuminated by the lights.
Layer-based collision detection: It is also possible to specify which
game objects can collide with which by enabling/disabling collisions
between their layers.