Example #1
0
    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);
        }
    }
Example #2
0
    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);
    }
Example #3
0
 public MySubClass()
 {
     firstBase  = this;
     secondBase = this;
 }
Example #4
0
 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();
 }