public static void LogWarning( string text ) { if (OnLogMessage != null) { var logMessage = new LogMessage() { text = text, type = LogMessageType.Warning }; OnLogMessage( logMessage ); } }
public static void LogError( string text ) { if (OnLogMessage != null) { var logMessage = new LogMessage() { text = text, type = LogMessageType.Error }; OnLogMessage( logMessage ); } }
void HandleOnLogMessage( LogMessage logMessage ) { switch (logMessage.type) { case LogMessageType.Info: Debug.Log( logMessage.text ); break; case LogMessageType.Warning: Debug.LogWarning( logMessage.text ); break; case LogMessageType.Error: Debug.LogError( logMessage.text ); break; } }