Skip to content

Instantly share code, notes, and snippets.

@RoeiRubach
Created November 12, 2021 10:11
Show Gist options
  • Select an option

  • Save RoeiRubach/3c12d5ead45a39b77ea48ce9d117b333 to your computer and use it in GitHub Desktop.

Select an option

Save RoeiRubach/3c12d5ead45a39b77ea48ce9d117b333 to your computer and use it in GitHub Desktop.
[Unity Editor Console Reporter]
using UnityEngine;
public static class ConsoleReporter
{
private static readonly string _cantFind = "coulnd't be found!";
private static readonly string _redError = "<b><color=red>Error: </color></b>";
private static readonly string _clickHighlight = "Click to highlight in hierarchy";
private static readonly string _inspectorWasntSet = "was not set in the inspector!";
public static void LogNullObject(string objectName)
{
Debug.Log($"{_redError} {objectName} {_cantFind}");
}
public static void LogInspectorRefMissing(string objectName, Transform hierarchyObject)
{
Debug.Log($"{_redError} {objectName} {_inspectorWasntSet}" +
$"<color=lightblue> {_clickHighlight} </color>", hierarchyObject);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment