return c# {0} code example
Example 1: how to return a value in c#
void Start()
{
Debug.Log(Message()/*calling the function with its name*/);
}
string Message()/*you can make values to functions with () and {}*/
{
string message = "Hello world";
return message;//this says which value will be returned
}
Example 2: c# get the return value of a func
Func<int> function;
int returnValue;
function = () => 0;
returnValue = function();