Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

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
    }
Source by anh.cs.luc.edu #
 
PREVIOUS NEXT
Tagged: #return
ADD COMMENT
Topic
Name
6+7 =