Hello, I try this tutorial (http://www.thegamecontriver.com/2014/09/create-level-lock-unlock-system-unity-46.html) to create a level unlock system, but the script give me 2 errors:
“Assets/Scripts/LevelSelectScript.cs(12,28): error CS1525: Unexpected symbol `<'” “Assets/Scripts/LevelSelectScript.cs(20,27): error CS8025: Parsing error”
This is the script:
using UnityEngine;
using System.Collections;
public class LevelSelectScript : MonoBehaviour {
private int worldIndex;
private int levelIndex;
void Start (){
//loop thorugh all the worlds
for(int i = 1; i <= LockLevel.worlds; i++){
if(<span id="IL_AD1" class="IL_AD">Application</span>.loadedLevelName == "World"+i){
worldIndex = i;
CheckLockedLevels();
}
}
}
//Level to load on button click. Will be used for Level button click event
public Selectlevel(string worldLevel){
Application.LoadLevel("Level"+worldLevel); //load the level
}
//uncomment the below code if you have a main menu scene to navigate to it on clicking escape when in World1 scene
/*public void Update (){
if (Input.GetKeyDown(KeyCode.Escape) ){
Application.LoadLevel("MainMenu");
}
}*/
//function to check for the levels locked
void CheckLockedLevels (){
//loop through the levels of a particular world
for(int j = 1; j < LockLevel.levels; j++){
levelIndex = (j+1);
if((PlayerPrefs.GetInt("level"+worldIndex.ToString() +":" +levelIndex.ToString()))==1){
GameObject.Find("LockedLevel"+(j+1)).active = false;
Debug.Log ("Unlocked");
}
}
}
Anyone can help me?