Hi there,
Is it possible to add the values of two functions together in a separate function?
public void TotalScoreLeft (int playerScoreLeft)
{
totalScoreLeft = playerScoreLeft;
Debug.Log ("Score is being added left" +totalScoreLeft);
}
public void TotalScoreRight (int playerScoreRight)
{
totalScoreRight = playerScoreRight;
Debug.Log ("Score is being added right" +totalScoreRight);
}
public void TotalScore (int totalScoreRight, int totalScoreLeft)
{
totalScore = totalScoreRight + totalScoreLeft;
Debug.Log ("Total score is: " + totalScore);
}
I basically want to display a GUI of TotalScores value, but the Debug.Log isn’t printing the value of totalScore. How could I add the values of TotalScoreLeft and TotalScoreRight together?
Many thanks.