C# (3) 썸네일형 리스트형 c# 타임스템프 사용하기 using system; TimeSpan m_LocalTime = DateTime.Now.ToLocalTime() - new DateTime (1970, 1, 1, 0, 0, 0, 0).ToLocalTime (); ulong _DiffTime = receivedTime - (ulong)m_LocalTime.TotalSeconds; float _timeTick = 0; void Update () { _timeTick += Time.deltaTime; if (_timeTick >= 1) { _DiffTime--; } } c# 숫자앞에 0 넣기 int a_hour = (int)(_time / 3600); int a_min = (int)_time % 3600 / 60; int a_sec = (int)_time % 3600 % 60; string.Format ("{0:D2} : {1:D2} : {2:D2}", a_hour, a_min, a_sec); => 01:59:06 바이너리 파일 읽어오기(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 다음