Ako urobit aby sa nejaky objekt deserializoval sam. napr.:
[Serializable]
public class Level
{
[NonSerialized]
public string FileName;
[NonSerialized]
private string FilePath;
List<LevelBuilding> Objects;
public Level(string FileName)
{
this.FileName = FileName;
this.FilePath = PLB.DirLevels + this.FileName;
if(File.Exists(this.FilePath))
{
this.LoadFromFile();
}
else
{
this.Objects = new List<LevelBuilding>();
this.SaveToFile();
}
}
Zatial mam danu serializaciu len toho listu akurat ja chcem pridat serializaciu aj necoho ineho, chcem dodat info, nazov,...