I have set up my game to where a player goes into a cube and when they reach the cube, they enter the next level/scene in the build settings, but no matter how i put the code, it doesn’t work the way I want it to.
public class GameManager : MonoBehaviour {
public static int currentScore;
public static int highScore;
public static int currentLevel = 0;
public static int unlockedLevel;
public static void CompleteLevel ()
{
Application.LoadLevel(currentLevel + 1);
}
}
^This Code takes me from level 1 to level 2, but once it gets to level 2, it stops proceeding.^
using UnityEngine;
using System.Collections;
public class GameManager : MonoBehaviour {
public static int currentScore;
public static int highScore;
public static int currentLevel = 0;
public static int unlockedLevel;
public static void CompleteLevel ()
{
Application.LoadLevel(currentLevel += 1);
}
}
^This code will take me to level 1, then two, then two again, then four.^
The Difference between the two codes is “Application.LoadLevel += 1”
I was wondering if somebody could help me make it so it goes level 1, 2, 3, 4, 5, 6 and so on.
Thanks!