static public XLoggerEditor Ctor() { XLoggerEditor xLoggerEditor = ScriptableObject.FindObjectOfType <XLoggerEditor>(); if (xLoggerEditor == null) { xLoggerEditor = ScriptableObject.CreateInstance <XLoggerEditor>(); } xLoggerEditor.Errors = 0; xLoggerEditor.Warnings = 0; xLoggerEditor.Messages = 0; xLoggerEditor.ErrorPause = false; xLoggerEditor.ClearOnPlay = false; xLoggerEditor.Playing = false; return(xLoggerEditor); }
void OnEnable() { if (!EditorLog) { EditorLog = XLogger.GetLogger <XLoggerEditor>(); if (!EditorLog) { EditorLog = XLoggerEditor.Ctor(); } } XLogger.AddLogger(EditorLog); EditorLog.AddWindow(this); titleContent.text = XLogGUIConstans.XLOG_EDITOR_NAME; ClearSelectedMessage(); ErrorIcon = EditorGUIUtility.FindTexture(XLogGUIConstans.XLOG_ICON_ERROR); WarningIcon = EditorGUIUtility.FindTexture(XLogGUIConstans.XLOG_ICON_WARNING); MessageIcon = EditorGUIUtility.FindTexture(XLogGUIConstans.XLOG_ICON_MESSAGE); DrawPos = Vector2.zero; CurrentTopPaneHeight = position.height / 2; DirtyLog = true; Repaint(); }