readbyte (2) 썸네일형 리스트형 파일) Unity Resource폴더와 저장소의 바이너리파일 읽기 (re : 2019.05.07) public BinaryReader PlayFileToBinary (string _fname) { TextAsset _textAsset = Resources.Load (_fname) as TextAsset; Stream _s; //if file not exist read from device storage if (_textAsset == null) { _s = GetBinaryFileStream (_fname); } else { _s = new MemoryStream (_textAsset.bytes); } BinaryReader br = new BinaryReader (_s, Encoding.Default); return br; } //get file from device storage public St.. 바이너리 파일 읽어오기(read a file as binaryreader) re:2019.05.11 바이너리 읽기 (read a file data) string _filename; => (resource폴더 이하의 경로 / 파일 확장자명 제외) TextAsset _textAsset = Resources.Load (filename) as TextAsset; Stream _s = new MemoryStream (_textAsset.bytes); BinaryReader br = new BinaryReader (_s); Debug.Log( br.ReadByte ()); Debug.Log( br.ReadInt32()); Debug.Log( br.ReadSingle()); ... 모든 바이트배열 얻기 (get all bytes) byte[] _all = br.ReadBytes ((int)br.BaseStream... 이전 1 다음