public void SaveDateToFile(FirstBase _base) { XmlSerializer serializer = new XmlSerializer(typeof(FirstBase)); using (FileStream streamForWrite = new FileStream("baseData.xml", FileMode.Create, FileAccess.Write)) { serializer.Serialize(streamForWrite, _base); } }
public FirstBase LoadDataFromFile() { FirstBase baseOfData = null; XmlSerializer serializer = new XmlSerializer(typeof(FirstBase)); using (FileStream streamForRead = new FileStream("baseData.xml", FileMode.Open, FileAccess.Read)) { baseOfData = (FirstBase)serializer.Deserialize(streamForRead); } return(baseOfData); }
public MySubClass() { firstBase = this; secondBase = this; }
void Start() { gameObj = LoadDataFromFile(); gameObject.AddComponent <Click>().SetData(levels[0]); GameObject.FindGameObjectWithTag("score").GetComponent <Text>().text = "Eggs : " + eggsCount.ToString(); }
void Test(FirstBase first) { first.Forbidden(); }