void OnEnable() { titleContent.text = "Messages"; _lineColour1 = GUI.backgroundColor; _lineColour2 = new Color(GUI.backgroundColor.r * 0.8f, GUI.backgroundColor.g * 0.8f, GUI.backgroundColor.b * 0.8f); _resizeAreaColour = new Color(_lineColour1.r * 0.5f, _lineColour1.g * 0.5f, _lineColour1.b * 0.5f); // Get or create the backend if (_messageLog == null) { _messageLog = MessageLogHandler.MessageLog; if (!_messageLog) { _messageLog = MessageLog.Create(); } } MessageLogHandler.MessageLog = _messageLog; _messageLog.LogEntryAdded += OnLogEntryAdded; #if UNITY_2017_2_OR_NEWER EditorApplication.playModeStateChanged += OnPlaymodeStateChanged; #else EditorApplication.playmodeStateChanged += OnPlaymodeStateChanged; #endif }