Nice!
Kiki SoDa
Creator of
Recent community posts
So, just to be clear on specifics then, the following should not count as lines:
- Lines that are simply curly braces: '{' or '}'
- Import lines: 'using UnityEngine;'
- Function definitions: 'void Start()'
- Class definitions: 'public class Character: MonoBehaviour'
However, the other lines would count:
- Variable declarations: 'public int test_var1 = 100;' and 'public float test_var2 = 200;'
- Modifying variables: ' test_var2 += ++test_var1;'
I didn't have any in the previous example, but would function calls or conditional statements and loops count?
Example:
for(int i = 0; i < 5; i++){
Debug.Log("This counts as a line?");
}else{
Debug.Log("Does the else count too?");
}
}
So, while the curly brackets do not count as a line, the for loop definition, if statement, else statement, and Log function calls would all count for a total of 5 lines?
I am curious what is considered a line for our games? Does it only count if we move to the next line with a newline/enter, or is it something more specific like a semicolon marks the end of a line?
As an example, how many lines would you say the following code contains?
using UnityEngine;
public class Character: MonoBehaviour
{
public int test_var1 = 100; public float test_var2 = 200;
void Start()
{ test_var2+=++test_var1;}
}