i want to be able to get the build number of the scene so i can then load the next level. this will allow me to use this script as a prefab therefore have infinite levels and not have to mannually change the build number ps. by build number i mean the number next to the scenes in build settings
using System;
using UnityEngine;
namespace UnityStandardAssets._2D
{
public class Finisher : MonoBehaviour
{
public int CurrentLevel;
private void OnTriggerEnter2D(Collider2D other)
{
if (other.tag == "Player")
{
CurrentLevel = Application.loadedLevelName; //instead of getting the name i want the build number
Application.LoadLevel(CurrentLevel + 1);
}
}
}
}