public static void MakeSurePath(string path) { if (!Directory.Exists(path)) { LogConsole.Log("正在创建目录…… " + path); try { Directory.CreateDirectory(path); } catch (Exception ex) { LogConsole.LogException(ex); LogConsole.Log("创建目录失败! " + path); } } }
private void OnGUI() { string tb = "ToolbarButton"; //s = EditorGUIUtility.GetBuiltinSkin(EditorSkin.Inspector).FindStyle("SearchTextField"); //s1 = EditorGUIUtility.GetBuiltinSkin(EditorSkin.Inspector).FindStyle("CN EntryInfo"); if (GUI.Button(new Rect(10, 10, 400, 200), "Print Log")) { Debug.Log("Test Unity Log"); Assert.IsTrue(false); LogConsole.Log("Test Log"); LogConsole.Log("MyTag", "Test Log With Tag"); LogConsole.Log("Test Log With Context", this); LogConsole.Log("MyTag", "Test Log With Tag And Context", this); LogConsole.LogFormat("Test Log {0} {1}({2},{3})", "With", "Format", 1, 2.9f); LogConsole.LogFormat(this, "Test Log {0} {1}({2},{3})", "With", "Format And Context", 1, 2.9f); LogConsole.LogWarning("Test Warning"); LogConsole.LogError("Test Error"); try { throw new System.Exception("Test Exception"); } catch (System.Exception ex) { LogConsole.LogException(ex); } try { throw new System.Exception("Test Exception With Context"); } catch (System.Exception ex) { LogConsole.LogException(ex, this); } Debug.LogAssertion("Unity assertion"); LogConsole.Assert(false, "Test if this assert can be printed in console"); } }