Hello. I have a really basic arcade game and i want to do some challenges for my game. All tutorials online are teaching the unlocking level system. But the thing is this is an arcade game so all levels are unlocked. I want to put a checkmark if the level is cleared. So do i have to write 15 times(there are 15 levels) the same code with a different number 15 times? And also the checkmark feature, do i have to create 15 PlayerPrefs integers and set them to 1 and the check if it is 1 15 times? Isn’t there an easier and quicker way?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class challenges : MonoBehaviour
{
public GameObject[] texts;
public GameObject[] checkmarks;
private void Start()
{
}
public void Update()
{
}
public void challenge(int button)
{
if (button == 1)
{
SceneManager.LoadScene("challenge " + button.ToString());
}
if (button == 2)
{
SceneManager.LoadScene("challenge " + button.ToString());
}
if (button == 3)
{
SceneManager.LoadScene("challenge " + button.ToString());
}
if (button == 4)
{
SceneManager.LoadScene("challenge " + button.ToString());
}
if (button == 5)
{
SceneManager.LoadScene("challenge " + button.ToString());
}
if (button == 6)
{
SceneManager.LoadScene("challenge " + button.ToString());
}
if (button == 7)
{
SceneManager.LoadScene("challenge " + button.ToString());
}
if (button == 8)
{
SceneManager.LoadScene("challenge " + button.ToString());
}
if (button == 9)
{
SceneManager.LoadScene("challenge " + button.ToString());
}
if (button == 10)
{
SceneManager.LoadScene("challenge " + button.ToString());
}
if (button == 11)
{
SceneManager.LoadScene("challenge " + button.ToString());
}
if (button == 12)
{
SceneManager.LoadScene("challenge " + button.ToString());
}
if (button == 13)
{
SceneManager.LoadScene("challenge " + button.ToString());
}
if (button == 14)
{
SceneManager.LoadScene("challenge " + button.ToString());
}
if (button == 15)
{
SceneManager.LoadScene("challenge " + button.ToString());
}
}
}