Quantcast
Channel: Questions in topic: "dontdestroyonload"
Viewing all articles
Browse latest Browse all 416

PlayerPrefs to save setActive state

$
0
0
Hi, I have some script that is run from my Game scene which hides a gameObject on my Menu scene. However each time the game is closed and reopened the gameObject in my Menu scene is set back to active. I want the gameObject that's been hidden to remain hidden, even through a game reload. This is the code that I have at the moment. DontDestroyOnLoad(gameObject); SceneManager.LoadScene("sceneSelectBeta"); GameObject[] gameObjectArray = GameObject.FindGameObjectsWithTag ("Level2Block"); foreach(GameObject go in gameObjectArray) { go.SetActive (false); PlayerPrefs.????? ("?????", ?????); } DestroyObject(gameObject); I use PlayerPrefs to save other information in my project, but I'm not sure how to implement it in this case, any help or advice would be much appreciated.

Viewing all articles
Browse latest Browse all 416

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>