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
Easy";
}
else if(difficutly == 2)
{
difficutlyLevel.text = “Your chosen difficutly level was
Medium!”;
}
else if(difficutly == 3)
{
difficutlyLevel.text = “Your chosen difficutly level was
Hard!!”;
}
destroy.text = "You Destroyed:
" + Brick.brokenBricks + " Bricks!";
attempts.text = “You dropped the ball
" + LevelManager.attempts -1 + " Times”;
}
private void SetScore(int difficulty)
{
}