Hi aan_comel,
You just need static counter. In previous answer mistake is at line where we are setting player prefs on button click using counter it should be through fetching playerprefs but as you don't need it so not correcting that.
public static int counter = 0;
void LoadLevel1()
{
if( counter<=3)
{
counter++;
Application.LoadLevel("levelName");
}
else
{
print("level already loaded for three times");
}
}
↧