I implemented a button that can switch between scene 1 and scene 2 on my software, but when I click on scene 2 and then go back to scene 1 the previous changes resets on scene 1, how can I keep these changes?
This is the script for home scene button:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class HomeScript : MonoBehaviour
{
public string sceneName; public Button loadSceneBtn;
void Start()
{
loadSceneBtn.onClick.AddListener(ChangeScene);
}
void ChangeScene()
{
SceneManager.LoadSceneAsync("Home");
}
}