Hi,
I’m pretty new to Unity and I need help with getting my script to award a player different medals based on how many points they scored in the level. The badges and the “Skill Cleared!” message are currently not appearing. What am I doing wrong?
Here is my script:
public class PlayerResults1 : MonoBehaviour {
public bool IsScoreEnough = false;
void OnLevelWasLoaded(int level) {
if (level == 8)
if (Score.score < 1500) {
IsScoreEnough = false;
Lives.curLives--;
} if (Score.score > 1500) {
IsScoreEnough = true;
}
ResultText (IsScoreEnough);
}
void ResultText(bool IsScoreEnough) {
if (IsScoreEnough == false)
{
guiText.text = "TRY AGAIN!";
guiText.material.color = Color.black;
}
else if (IsScoreEnough == true)
if (Score.score > 1500) {
Application.LoadLevel("Bronze1");
}
else if (Score.score > 3000){
Application.LoadLevel("Silver1");
}
else if (Score.score > 4500){
Application.LoadLevel("Gold1");
{
guiText.text = "SKILL CLEARED!";
guiText.material.color = Color.black;
}
}
}
}
Any assistance is appreciated.
Thanks.