Saving an image's state
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. 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 int GetScore(){
return score;
}
}
Answer by KristianGrytdal · Aug 09, 2016 at 02:11 PM
Of course the image is gone be "SetActive" from another scene, by this button. (So this button on an off is the two states it's in)
Your answer
![](https://koobas.hobune.stream/wayback/20220612090425im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Save a Image's state 1 Answer
SetActive dosen't work 0 Answers
Save Image state between scenes 0 Answers
Big numbers 2 Answers
In the next scene tell player there score out of total using player prefab before next level 1 Answer