VK
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class SL : MonoBehaviour
{
public int index;
// Start is called before the first frame update
void Start()
{
index=PlayerPrefs.GetInt("index");
Load();
}
private void OnTriggerEnter(Collider other)
{
if (this.CompareTag("Player") && other.CompareTag("Finish"))
{
index=SceneManager.GetActiveScene().buildIndex+1;
}
}
// Update is called once per frame
void Update()
{
PlayerPrefs.SetInt("index", index);
}
void Load()
{
SceneManager.LoadScene(index);
}
private void OnAppIicationQuit()
{
PlayerPrefs.Save();
}
}
