The term method overloading refers to creating multiple methods with the same name but with different signatures. A method's signature is made up of its name and parameters, which is how the C# compiler recognizes it. Take the following method as an example:
public bool AttackEnemy(int damage) {}
The method signature of AttackEnemy is written as follows:
AttackEnemy(int)
Now that we know the signature of AttackEnemy, it can be overloaded by changing the number of parameters or the parameter types themselves, while still keeping its name. This offers added flexibility when you need more than one option for a given operation.
The RestartLevel() method in GameBehavior is a great example of a situation where method overloading comes in handy. Right now, RestartLevel() only restarts the current level, but what happens if we expanded the game so that it includes multiple scenes? We could refactor RestartLevel() to accept parameters, but that often leads...