03/10/2024
Programming in Unity
Object-Oriented Thinking
• Everything is an object
• Objects have properties (variables)
• Objects have methods (functions)
• GameObjects as Objects
1
03/10/2024
2
03/10/2024
3
03/10/2024
Object-Oriented Concepts
• Classes are templates for objects
• Classes are linked in a hierarchy
• A class can do anything its parent class can (inheritance)
• A class can override its parent’s functionality (polymorphism)
• Objects are instantiated from a class
• An object gets all the properties and methods that are defined in
the class
4
03/10/2024
10
5
03/10/2024
11
12
6
03/10/2024
13
14
7
03/10/2024
15
16
8
03/10/2024
17
18
9
03/10/2024
19
20
10
03/10/2024
21
22
11