d
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class SL : MonoBehaviour
{
public int indexS=1;
private void OnTriggerEnter(Collider other)
{
if (this.CompareTag("Player") && other.CompareTag("Finish"))
{
indexS+=1;
PlayerPrefs.SetInt("indexS", indexS);
PlayerPrefs.Save();
}
}
public void Load()
{
indexS=PlayerPrefs.GetInt("indexS");
SceneManager.LoadScene(indexS);
}
public void LoadStart()
{
SceneManager.LoadScene(0);
}
}
"indexS" это const где-то в классе, потому что есть риск поменять в одном месте и не поменять в других

