Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

Switch statement

// The argument can be all sorts of different types. In this case it is an Int.
switch (Argument_Example){
    case 0:
        Debug.Log("Argument = 0");
        break; // 'break' is used to mark the end of a section.
    case 1:
        Debug.Log("Argument = 1");
        break;
    case 2:
        Debug.Log("Argument = 2");
        break;
    case 3:
        Debug.Log("Argument = 3");
        break;
    case 4:
        Debug.Log("Argument = 4");
        break;
    case 5:
        Debug.Log("Argument = 5");
        break;
}
 
PREVIOUS NEXT
Tagged: #Switch #statement
ADD COMMENT
Topic
Name
6+7 =