Creating C# scripts
This book is intended for readers with some programming knowledge, but in this first section, we are going to discuss the C# script structure to make sure you have a strong foundation for the behaviors we will code in the following chapters.
In this section, we will examine the following script creation concepts:
- Initial setup
- Creating a MonoBehaviour-based class
- Adding fields
We are going to create our first Unity script, which will serve to create our component, discussing the tools needed to do so and exploring how to expose our class fields to the editor. Let's start with the basics of script creation.
Initial setup
One thing to consider before creating our first script is how Unity compiles code. While coding, we are used to having an Integrated Development Environment (IDE), which is a program to create our code and compile or execute it. In Unity, we will just use an IDE as a tool to create scripts easily with coloring...