Working with Classes, Structs, and OOP

Obviously, the goal of this book isn't to give you a nervous breakdown, but these next topics will definitely take you out of the beginner's cubicle and into the open air of object-oriented programming (OOP). Up to this point, we've been relying exclusively on predefined variable types that are part of the C# language; under-the-hood strings, lists, and dictionaries that are classes, which is why we can create them and use their properties through dot notation. However, relying on built-in types has one glaring weakness—the inability to deviate from the blueprints that C# has already set.

Creating your own classes gives you the freedom to define and configure blueprints of your own design, capturing ...

Get Learning C# by Developing Games with Unity 2019 - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.