using UnityEngine; using System.Collections; using System.Collections.Generic; using LitJson; public class ChatMsg { public enum Category { System = 0, Clan = 1, Follow = 2, Request = 3, Replay = 4, } private static Dictionary catDict; public static Category GetCategoryByCode(int code) { if (catDict == null) { catDict = new Dictionary (); System.Array arr = System.Enum.GetValues (typeof(Category)); for(int i=0; i 0) str += day.ToString () + Language.GetStr ("Time", "d") + " "; if(hour > 0) str += hour.ToString () + Language.GetStr ("Time", "h") + " "; if(min > 0) str += min.ToString () + Language.GetStr ("Time", "min") + " "; if (StringUtil.Empty (str)) str = Language.GetStr ("Time", "justNow"); else str += Language.GetStr ("Time", "ago"); return str; } private static float loginTime; private static System.DateTime loginDateTime; public static void InitDateTime(string loginDateTime) { ChatMsg.loginDateTime = System.Convert.ToDateTime(loginDateTime); loginTime = GameTime.realtimeSinceStartup; } public static System.DateTime GetNowDateTime() { long ticks = loginDateTime.Ticks + (long) (GameTime.realtimeSinceStartup - loginTime) * 10000000; return new System.DateTime(ticks); } private ReplayInfo replayInfo; public ReplayInfo GetReplayInfo() { if (replayInfo == null) { replayInfo = new ReplayInfo (content); } return replayInfo; } }