Understanding the concepts of scripting in Unity
Let's get started with understanding the concepts of scripting in Unity. We know that Unity is not an open source engine; except for enterprise users and users who subscribe to the Pro plan, no one else can access Unity's source code. However, Unity's C# API is open source. Because the C# API is just a wrapper, it does not include the internal logic of the engine. But Unity's open source C# API is also a good reference for us to understand script programming in Unity. You can access it on GitHub: https://github.com/Unity-Technologies/UnityCsReference.
GameObject-components architecture
First of all, I want to let you know that Unity is a component-based system. So, the two terms you often hear in Unity game development are GameObject and component. A GameObject is nothing more than a container for components. It represents an object in the game world, but it does not have any function itself. On the other hand...