In this chapter, you learn to take advantage of the immense power of functions. You write your own custom functions that can take various kinds of variables as input arguments and can return a single variable as the function's result. I also cover some special cases of parameters for function input like function overloading, optional parameters, and the params keyword modifier, all of which will help you to write more effective, modular, reusable, and flexible code.

Setting Up the Function Examples Project

In Appendix A, "Standard Project Setup Procedure," detailed instructions show you how to set up Unity projects for the chapters in this book. At the start of each project, you will also see a sidebar like ...

Get Introduction to Game Design, Prototyping, and Development: From Concept to Playable Game with Unity and C#, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.