void CheckConflictModule() { bool hasJoystick = false; hasJoystick = HasMonoJoystick; if (hasJoystick && HasDualJoystick) { LogConsole.LogWarning("InputModuleManager", "MonoJoystick,DualJoystick,MonoJoystickSimulator,DualJoystickSimulator,这四种输入模块只能选用一个"); } else if (HasDualJoystick) { hasJoystick = true; } if (hasJoystick && HasMonoJoystickSimulator) { LogConsole.LogWarning("InputModuleManager", "MonoJoystick,DualJoystick,MonoJoystickSimulator,DualJoystickSimulator,这四种输入模块只能选用一个"); } else if (HasMonoJoystickSimulator) { hasJoystick = true; } if (hasJoystick && HasDualJoystickSimulator) { LogConsole.LogWarning("InputModuleManager", "MonoJoystick,DualJoystick,MonoJoystickSimulator,DualJoystickSimulator,这四种输入模块只能选用一个"); } else if (HasDualJoystickSimulator) { hasJoystick = true; } if (HasButtonPad && HasButtonPadSimulator) { LogConsole.LogWarning("InputModuleManager", "ButtonPad,ButtonPadSimulator,这两种输入模块只能选用一个"); } }
static public void LogWarning(object message, string customType) { if (EnableLog) { LogConsole.LogWarning(message, customType); //Debug.LogWarning(string.Format("message:{0} customType:{1}", message, customType)); } }
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"); } }
public void LogWarning_NullMessage_ThrowArgumentNullException() { log.LogWarning(null); }