I am working on creating a levling system and I cant find anything on how case strucktures work in unity. I have worked in pure c# and created a case structor just not sure whats going on with it in Unity here. Here is my code so far then the error I am geting. If no one know a good solluction would any one plz recomend where I might find some help making a leveling system?
using UnityEngine;
using System.Collections;
public class PlayerStatus : MonoBehaviour
{
public int curExperience = 1;
public int curLevel = 1;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update ()
{
switch(curLevel){
case 0:
if(curExperience <= 24){
curLevel += 0;
}
case 1:
if(curExperience >= 25){
curLevel += 1;
}
break;
case 2:
if(curExperience >= 55){
curLevel += 1;
}
break;
case 3:
if(curExperience >= 95){
curLevel += 1;
}
break;
case 4:
if(curExperience >= 130){
curLevel += 1;
}
break;
case 5:
if(curExperience >= 182){
curLevel += 1;
}
break;
case 6:
if(curExperience >= 254){
curLevel += 1;
}
break;
case 7:
if(curExperience >= 356){
curLevel += 1;
}
break;
case 8:
if(curExperience >= 500){
curLevel += 1;
}
break;
case 9:
if(curExperience >= 700){
curLevel += 1;
}
break;
case 10:
if(curExperience >= 990){
curLevel += 1;
}
break;
}
}
}
This is the error I am geting:
Assets/PlayerStatus.cs(18,9): error CS0163: Control cannot fall through from one case label to another.
If no one know a good solluction would any one plz recomend where I might find some help making a leveling system?