passing variables between methods in the same script.

I have a script that I am loading when a player reaches the win screen, in this script my start sets some private variables and calls two other methods. However, when I try to pass the variables those methods need I get an parse error.

"Parser Error: Unexpected symbol ‘difficultySet’, expecting ‘.’

why would monodevloper be expecting a dot for these variables? I am newish to C# but in java this is how variables are passed…and C# java are (in my experience so far) almost carbon copies.

All of my searching is turning up other questions about passing variables between scripts so they were no help.

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class WinScript : MonoBehaviour 
	public Text destroy;
	public Text attempts;
	public Text difficutlyLevel;
	private int difficultySet;
	private int brokenBricks;
	private int attemptsMade;

	// Use this for initialization
	void Start () 
		difficultySet = StartButtons.difficultyChosen;
		brokenBricks = Brick.brokenBricks;
		attempts = LevelManager.attempts;

            // errors appear on the 2 lines below.
		SetText(int difficultySet);
		SetScore(int difficultySet, int brokenBricks, int attemptsMade);
	// Update is called once per frame
	void Update () 

	private void SetText(int difficutly)
		if(difficutly == 1)
			difficutlyLevel.text = "Your chosen difficutly level was

else if(difficutly == 2)
difficutlyLevel.text = “Your chosen difficutly level was
else if(difficutly == 3)
difficutlyLevel.text = “Your chosen difficutly level was

		destroy.text = "You Destroyed:

" + Brick.brokenBricks + " Bricks!";
attempts.text = “You dropped the ball
" + LevelManager.attempts -1 + " Times”;


	private void SetScore(int difficulty)


Actually that is exactly the cause of the error. When you had ‘int’ in the method call, it was thinking you were calling the ‘int’ class to use a method (like int.Parse), so it was expecting the dot operator to call a method.

Also, you don’t need to use ‘this’ in most situations, the method calls can be done like this:


It’s not an error to use ‘this’, but it does make it slightly cleaner to not have it.