
Learning C# by Developing Games with Unity 3D Beginner's Guide
By :

Just like for variables, we have to let Unity know about a method before we can use it.
Depending on who you talk to, some will say we have to declare a method, others will say we have to define a method. Which is correct? In C#, it doesn't make any difference. Use which ever term helps you learn easier. I like to say I'm defining a method's code block, nothing like declaring a simple variable on a one line statement.
There are three minimum requirements for defining a method:
The type of information, or data, a method will return to the place where the method was called
The name of the method should be followed by a pair of parentheses
A pair of curly braces should be present for containing the code block:
returnDataType NameOfTheMethod ( ) { }
Looking at LearningScript
once again, or any Unity generated script, the Start()
method has the three bare-bone minimum requirements for a method:
void Start () { }
Here's what we...
Change the font size
Change margin width
Change background colour