Time for action – adding code between the parentheses

We're going to modify LearningScript to send some information to the AddTwoNumbers() method to make it much more useful.

Why would we need to send information to a method?

A script may need to add two numbers several times, but they probably won't always be the same two numbers. We could possibly have hundreds of different combinations of "two numbers" to add together. This means that we need to let the method know, which two numbers need to be added together at the moment when we call the method.

Time for action – adding code between the parentheses

Using the preceding screenshot, perform the following steps:

  1. Open LearningScript in MonoDevelop to modify ...

Get Learning C# by Developing Games with Unity 3D Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.