Combining Interers


Currently I am working on a point system. Every time the player bumps in to a coin the coin will be added towards his total coins het collect in this level and added on his total coins collected throughout the entire game.

However this must be added after the player finished the level, not while playing the level

int coinCollected = 12
int totalCoinsCollected = 2
after the player finish, int totalCoinsCollected needs to be: 12 + 2 (I want this to be 14 not 122)

you just need to create a new variable and do the calculation there

int temp = coincollected + totalcoinscollected;
Debug.Log("Total coins collected = " + temp);