So what I am trying to accomplish is when I load a scene I want to have certain objects to be active or inactive depending on their the information saved in my files.
Example being :
In my game, when I load one of my scenes there is a wall, then I push a bookcase to a certain point and triggers the wall to be set to inactive. I exit this scene and come back to the scene and the wall is active again. What I want is when the wall is set inactive, it stays inactive even when I leave the scene and and won't appear when I come back to the scene later.
The trouble I am having is how to do this. At the moment what I have is when the player clicks the "New Game" button I generate a new Game_Info and select the Default() :
[Serializable]
public class Game_Info {
public bool WoodWallEnabled;
public void Default(){
WoodWallEnabled = true;
}
}
My WoodWall script :
public class Get_WoodWall_Info : MonoBehaviour {
void Awake () {
gameObject.SetActive (Helper_Manager.instance.gameInfo.WoodWallEnabled);
}
}
I have a feeling I am not doing this the right way and that there is a better way to handle this, especially since doing like this would need a unique script for each gameobject that I would like to manipulate through my saved file (Get_WoodWall_Info, Get_WoodWall_Info1, etc...) but even if I created enourmous amounts of scripts to do this, I can't find a way to save the state of the gameobjects.
How would you handle and pass around this kind of data?