Reader small image

You're reading from  Learning C# by Developing Games with Unity - Seventh Edition

Product typeBook
Published inNov 2022
Reading LevelBeginner
PublisherPackt
ISBN-139781837636877
Edition7th Edition
Languages
Tools
Right arrow
Author (1)
Harrison Ferrone
Harrison Ferrone
author image
Harrison Ferrone

Harrison Ferrone is an instructional content creator for LinkedIn Learning and Pluralsight, tech editor for the Ray Wenderlich website, and used to write technical documentation on the Mixed Reality team at Microsoft. He is a graduate of the University of Colorado at Boulder and Columbia College, Chicago. After a few years as an iOS developer at small start-ups, and one Fortune 500 company, he fell into a teaching career and never looked back.
Read more about Harrison Ferrone

Right arrow

The Journey Continues

If you started this book as a complete newcomer to the world of programming, congratulations on your achievement! If you came in knowing a bit about Unity or another scripting language, guess what? Congratulations to you as well. If you began with all the topics and concepts we covered already firmly solidified in your head, you guessed it: congratulations. There is no such thing as an insignificant learning experience, no matter how much or how little you may think you came away with. Revel in the time you spent learning something new, even if it only turned out to be a new keyword.

As you reach the end of this journey, it’s important to look back at the skills you’ve acquired along the way. As with all instructional content, there’s always more to learn and explore, so this chapter will focus on cementing the following topics and giving you resources for your next adventure:

  • Diving deeper
  • Object-oriented programming...

Diving deeper

While we’ve done a good amount of work with variables, types, methods, and classes throughout this book, there are still areas of C# that were left unexplored.

Learning a new skill shouldn’t be a simple bombardment of information without context; it should be a careful stack of bricks, one on top of the other, each building on the foundational knowledge already acquired.

Here are some of the concepts you’ll want to look into as you progress in your programming journey, regardless of whether it’s with Unity or diving into .NET with C#:

  • Optional and dynamic variables
  • Debugging approaches
  • Concurrent programming
  • Networking and RESTful APIs
  • Recursion and reflection
  • Design patterns
  • Functional programming

As you revisit the code we’ve written throughout this book, don’t just think about what we accomplished, but also about how the different parts of our project work...

Remembering your object-oriented programming

OOP is a vast field of expertise, and its mastery requires not only study but also time spent applying its principles to real-life software development.

With all the foundational information you learned in this book, it might seem like a mountain you’re just better off not even attempting to climb. However, when you feel that way, take a step back and revisit these key concepts from Chapter 5Working with Classes, Structs, and OOP:

  • Classes are blueprints for objects you want to create in code
  • They can contain properties, methods, and events
  • They use constructors to define how they are instantiated
  • Instantiating objects from a class blueprint creates a unique instance of that class
  • Classes are reference types, meaning when the reference is copied it’s not a new instance
  • Structs are value types, meaning when the struct is copied a brand-new instance is created
  • Classes...

Design patterns primer

Before we wrap up the book, I want to talk about a concept that will play a huge part in your programming career: design patterns. Googling design patterns or software programming patterns will give you a host of definitions and examples, which can be overwhelming if you’ve never encountered them before. Let’s simplify the term and define a design pattern as follows:

A template for solving programming problems or situations that you’ll run into on a regular basis during any kind of application development. These are not hardcoded solutions—they’re more like tested guidelines and best practices that can be adapted to fit a specific situation.

There’s a lot of history behind how design patterns became an integral part of the programming lexicon, but that excavation is up to you.

If this concept strikes a chord with your programming brain, start with the book Design Patterns: Elements of Reusable...

Approaching Unity projects

Even though Unity is a 3D game engine, it still has to follow the principles set down by the code it’s built on. When you think of your game, remember that the GameObjects, components, and systems you see on screen are just visual representations of classes and data; they’re not magical or unknown—they’re the result of taking the programming foundations you’ve learned in this book to their advanced conclusion.

Everything in Unity is an object, but that doesn’t mean all C# classes have to work within the engine’s MonoBehaviour framework. Don’t be limited to thinking only about in-game mechanics; branch out and define your data or behavior the way your project needs. 

Lastly, always ask yourself how you can best separate code out into pieces of functionality instead of creating huge, bloated, thousand-line classes. Related code should be responsible for its behavior and stored...

Unity features we didn’t cover

We managed to briefly cover many of Unity’s core features in Chapter 6Getting Your Hands Dirty with Unity, but there is still so much more the engine has to offer. These topics aren’t in any particular order of importance, but if you’re going forward with Unity development, you’ll want to have at least a passing familiarity with the following:

  • Shaders and effects
  • Scriptable objects
  • Editor extension scripting
  • Non-programmatic UI
  • ProBuilder and Terrain tools
  • PlayerPrefs and saving data
  • Model rigging
  • Animator states and transitions

You should also go back and dive into Lighting, Navigation, Particle Effects, and Animation features in the editor.

Next steps

Now that you have a basic level of literacy in the C# language, you’re ready to seek out additional skills and syntax. This most commonly takes the form of online communities, tutorial sites, and YouTube videos, but it can also include textbooks, such as this one. Transitioning from being a reader to an active member of the software development community can be tough, especially with the abundance of options out there, so I’ve laid out some of my favorite C# and Unity resources to get you started.

C# resources

When I’m developing games or applications in C#, I always have the Microsoft documentation open in a window I can get to easily. If I can’t find an answer to a specific question or problem, I’ll start checking out the community sites I use most often:

Hero’s trial—putting something out into the world

The last task I’ll offer you in this book is probably the hardest, but also the most rewarding. Your assignment is to take your C# and Unity knowledge and create something to put out into the software- or game-development communities. Whether it’s a small game prototype or a full-scale mobile game, get your code out there in the following ways:

Whatever your passion project is, put it out into the world.

Summary

You might be tempted to think that this marks the end of your programming journey, but you couldn’t be more wrong. There is no end to learning, only a beginning. We set out to understand the building blocks of programming, the basics of the C# language, and how to transfer that knowledge into meaningful behaviors in Unity. If you’ve gotten to this last page, I’m confident you’ve achieved those goals, and you should be too.

One last word of advice that I wish someone had told me when I first started: you’re a programmer if you say you are. There will be plenty of people in the community that will tell you that you’re an amateur, that you lack the experience necessary to be considered a “real” programmer, or, better yet, that you need some kind of intangible professional stamp of approval. That’s false: you’re a programmer if you practice thinking like one regularly, aim to solve problems with efficiency...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Learning C# by Developing Games with Unity - Seventh Edition
Published in: Nov 2022Publisher: PacktISBN-13: 9781837636877
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Harrison Ferrone

Harrison Ferrone is an instructional content creator for LinkedIn Learning and Pluralsight, tech editor for the Ray Wenderlich website, and used to write technical documentation on the Mixed Reality team at Microsoft. He is a graduate of the University of Colorado at Boulder and Columbia College, Chicago. After a few years as an iOS developer at small start-ups, and one Fortune 500 company, he fell into a teaching career and never looked back.
Read more about Harrison Ferrone