public static void SaveGestureQuantity(MasterControl mastercontrol) { BinaryFormatter formatter = new BinaryFormatter(); //string path = Application.persistentDataPath + "/testcontrol.banana"; string path = "C:/Users/Andrei/Documents/Unity Games/Hand Gesture Recognition/GestureAlbums/_gestureQuantity.banana"; FileStream stream = new FileStream(path, FileMode.Create); GestureQuantityData data = new GestureQuantityData(mastercontrol); formatter.Serialize(stream, data); stream.Close(); }
public static GestureQuantityData LoadGestureQuantity() { //string path = Application.persistentDataPath + "/testcontrol.banana"; string path = "C:/Users/Andrei/Documents/Unity Games/Hand Gesture Recognition/GestureAlbums/_gestureQuantity.banana"; if (File.Exists(path)) { BinaryFormatter formatter = new BinaryFormatter(); FileStream stream = new FileStream(path, FileMode.Open); GestureQuantityData data = formatter.Deserialize(stream) as GestureQuantityData; stream.Close(); return(data); } else { Debug.LogError("Save file not found in " + path); return(null); } }
public void LoadGestureQuantity() { GestureQuantityData data = GestureSaveSystem.LoadGestureQuantity(); gestureQuantity = data.gestureQuantity; }