Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

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++){

if(this_counts_as_a_line){

        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?