Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fundaments of Game Design

Similar presentations


Presentation on theme: "Fundaments of Game Design"— Presentation transcript:

1 Fundaments of Game Design
Unity Components Richard Gesick

2 Objectives Unity components Unity inheritance relationships
Casting and assignments

3 Unity components Components are the nuts & bolts of objects and behaviors in a game. They are the functional pieces of every GameObject. GameObject is a container for many different Components. By default, all GameObjects automatically have a Transform Component. use the Inspector to see which Components are attached to the selected GameObject. As Components are added and removed, the Inspector will always show you which ones are currently attached.

4 Components (2) One of the great aspects of Components is flexibility. When you attach a Component to a GameObject, there are different values or Properties in the Component that can be adjusted in the editor while building a game, or by scripts when running the game. Components can include references to any other type of Component, GameObjects, or Assets

5 Unity components A child object inherits the transform of the parent game object. As such, its position is now a local coordinate or an offset from the parent, rather than a world coordinate. When using an empty game object as a “grouping object”, set its transform position to (0,0,0). Then the child objects local and world coordinates will be the same.

6 Unity components (2) Unity treats the components as a bucket of elements. A game object can be treated as any of its individual components. Thus game objects that have a rigidbody component could be cast as rigidbodies and stored in a collection of rigidbodies. This will be handy when we want to use polymorphism. A script that is added to a game object is also a component.


Download ppt "Fundaments of Game Design"

Similar presentations


Ads by Google