void GetPngInFolder(string[] paths) { int i = 0; foreach (string path in paths) { if (path.EndsWith("R.png")) { Debug.Log(path); Texture2D img = new Texture2D(320, 240); ImageConversion.LoadImage(img, File.ReadAllBytes(path)); REyeImgList.Add(img); } else if (path.EndsWith("L.png")) { Texture2D img = new Texture2D(320, 240); ImageConversion.LoadImage(img, File.ReadAllBytes(path)); LEyeImgList.Add(img); } i++; if (i % 100 == 0) { Resources.UnloadUnusedAssets(); System.GC.Collect(); } } Debug.Log(REyeImgList.Count); Debug.Log(LEyeImgList.Count); }
public void closeTheFile() { isPlaying = false; inPlayMode = false; mainScript.resetEverything(); DataRecorder.EnableLogging(true); hidePlaybackUI(); fileOpenButton.gameObject.SetActive(true); fileTitle.text = ""; sr.Close(); Debug.Log("Closed reader"); leftCamera.transform.rotation = leftCameraOrigRot; rightCamera.transform.rotation = rightCameraOrigRot; leftCamera.transform.position = leftCameraOrigPos; rightCamera.transform.position = rightCameraOrigPos; myProtocolRecorder.setAllowRecording(true); REyeImgList.Clear(); LEyeImgList.Clear(); Resources.UnloadUnusedAssets(); System.GC.Collect(); logInfoDisplay.ResetAll(); }