Save Image state between scenes
I have a script that saves how many points a player has between scenes, but i wonder if it's possible to make it so it saves the state of a image. The image is gone be "SetActive" from another scene, and then i need a script that remember which state the image is in. the image is gone be "SetActive" from another scene, by this button. (So this button on and off is the two states it's gone be in) This is the script that saves the points.Thanks in advance :)
using UnityEngine; using System.Collections; using UnityEngine.SceneManagement;
public class GameStatus : MonoBehaviour {
public int score = 0;
void Start () {
score = PlayerPrefs.GetInt ("score", 0);
}
void Update () {
}
void OnDestroy(){
Debug.Log ("Fail");
PlayerPrefs.SetInt ("score", score);
}
public void AddScore(int s){
score += s;
}
public int GetScore(){
return score;
}
public void LoadScene(string sceneName){
SceneManager.LoadScene (sceneName);
}
}
Your answer
Follow this Question
Related Questions
Saving an image's state 2 Answers
Save a Image's state 1 Answer
SetActive dosen't work 0 Answers
Is it possible to make a script that pushes this button? 1 Answer
Making an image appear 0 Answers