Let's update GenerateCharacter() so that it can take in two parameters:
- Add two method parameters: one for a character's name of the string type, and another for a character's level of the int type.
- Update Debug.Log() so that it uses these new parameters.
- Update the GenerateCharacter() method call in Start() with your arguments, which can be either literal values or declared variables:
Here, we defined two parameters, name (string) and level (int), and used them inside the GenerateCharacter() method, just like local variables. When we called the method inside Start(), we added argument values for each parameter with corresponding types. In the preceding screenshot, you can see that using the literal string value in quotations produced the same result as using characterLevel:
Going even further with methods, you might be wondering how we can pass values from inside the method and back out again...