public static void Close() { if (null != _ins) { GameObject.Destroy(_ins.gameObject); _ins = null; } }
/// <summary> /// 在一个UI面板中显示一条日志消息 /// </summary> /// <param name="content"></param> public static void GUI(string content) { if (!IsActive) { return; } content = string.Format("[{0}] {1}", DateTime.Now.ToString("HH:mm:ss.fff"), content); Debug.Log(content); GUILog.Show(content); }
public static void Show(string content) { if (null == _ins) { const string NAME = "GUILog"; GameObject go = new GameObject(); go.name = NAME; _ins = go.AddComponent <GUILog>(); DontDestroyOnLoad(go); } _ins.SetContent(content); }