[System.Serializable]
public class Level_Data
{
public string LVLID;
public bool LevelComplete;[Space(20)]
public string AnimationState;
public Wire_Dictionary Wires;
public Switch_Dictionary Switches;
public Slider_Dictionary Sliders;
public Moving_Part_Dictionary Moving_Parts;
// switch dictionary
// transmitter dictionary
//cartirge dictionary
}
I'm wanting to save level data for each level which includes the data for all the levelobjects in the level. The thing is each level is different, most levels will only include a few different levelobjects. So when I go to save a level I have an empty dictionary of every different levelobject that could be in a level and maybe only one or two actual populated dictionaries.
Is this fine to have it like this? it seems like a bit of a waste also it's a bit ugly in the inspector. Or is there a way to save just the levelobjects in that level and not have a refence to every possible levelobject that could be in the leveldata class.
For how the game works I would much prefer to save the leveldata all together and not have a file for each levelobject data.
I'm using a serialized dictionary as well which lets me serialize dictionaries. For example I have WireDictionary (WireData is variables I want to save for the wire) then on the wire object I just pass that onto it.
I've had a look at interfaces, and sub classes and I just can't get my head around it.
not sure what to do, having possible lots and lots of references that aren't gonna be used is a bit of waste of space.
Is this fine to have it like this? it seems like a bit of a waste also it's a bit ugly in the inspector. Or is there a way to save just the levelobjects in that level and not have a refence to every possible levelobject that could be in the leveldata class.
For how the game works I would much prefer to save the leveldata all together and not have a file for each levelobject data.
I'm using a serialized dictionary as well which lets me serialize dictionaries. For example I have WireDictionary (WireData is variables I want to save for the wire) then on the wire object I just pass that onto it.
I've had a look at interfaces, and sub classes and I just can't get my head around it.
not sure what to do, having possible lots and lots of references that aren't gonna be used is a bit of waste of space.