overview functions

1
Functions/Methods A function is just like a variable except it contains code instead data. It helps to make the code look clean by just writing the name of function instead of writing the whole code again. A function is a code block. The code block begins and ends with curly braces. Once the method is declared/define, it can be executed by calling just its name. The second reason for using methods in a script is to provide behavior to a GameObject by working with the variables.

Upload: maaz

Post on 05-Jan-2016

215 views

Category:

Documents


0 download

DESCRIPTION

A brief overview of functions in programming.

TRANSCRIPT

Functions/Methods A function is just like a variable except it contains code instead data. It helps to make the code look clean by just writing the name of function instead of writing the whole code again. A function is a code block. The code block begins and ends with curly braces. Once the method is declared/define, it can be executed by calling just its name. The second reason for using methods in a script is to provide behavior to a GameObject by working with the variables.