Пример #1
0
    public static void SaveData(UITests myBehaviour)
    {
        BinaryFormatter formatter = new BinaryFormatter();

        FileStream stream = new FileStream(path, FileMode.Create);

        DataManagerTest saveData = new DataManagerTest(myBehaviour);

        formatter.Serialize(stream, saveData);
        stream.Close();
    }
Пример #2
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.S))
     {
         SaveSystem.SaveData(this);
     }
     if (Input.GetKeyDown(KeyCode.L))
     {
         DataManagerTest data = SaveSystem.LoadData();
         if (data == null)
         {
             return;
         }
         img.color = new Color(data.colorData[0], data.colorData[1], data.colorData[2]);
         img.GetComponent <RectTransform>().anchoredPosition = new Vector2(data.positionData[0], data.positionData[1]);
         img.GetComponent <RectTransform>().rotation         = Quaternion.Euler(0, 0, data.zRotationData);
     }
 }
Пример #3
0
    public static DataManagerTest LoadData()
    {
        if (File.Exists(path))
        {
            BinaryFormatter formatter = new BinaryFormatter();

            FileStream stream = new FileStream(path, FileMode.Open);

            DataManagerTest loadData = formatter.Deserialize(stream) as DataManagerTest;

            stream.Close();
            return(loadData);
        }
        else
        {
            Debug.Log("ERROR LOADING DATA");
            return(null);
        }
    }
Пример #4
0
 public ReportController()
 {
     dataManager = new DataManagerTest();
 }