示例#1
0
 public static byte[] GetLogEntryBytes(BlackLogEntry.Type type, int arg1, long arg2)
 {
     return(BitConverter.GetBytes(DateTime.UtcNow.Ticks)
            .Concat(BitConverter.GetBytes((int)type))
            .Concat(BitConverter.GetBytes(arg1))
            .Concat(BitConverter.GetBytes(arg2)).ToArray());
 }
示例#2
0
 public static void Add(BlackLogEntry.Type type, int arg1, long arg2)
 {
     try
     {
         if (instance != null && instance.writeLogStream != null)
         {
             var logBytes = GetLogEntryBytes(type, arg1, arg2);
             instance.writeLogStream.Write(logBytes, 0, logBytes.Length);
             // 로그 항목이 생길 때마다 UI를 업데이트하는 것은 일반적인 유저에게는 불필요한 일이다.
             if (Application.isEditor && instance.logViewer != null)
             {
                 instance.logViewer.Refresh();
             }
         }
     }
     catch
     {
     }
 }