Pro_Unit

Method Log

Feb 17th, 2022 (edited)
415
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None | 0 0
  1. // Method extensions
  2. public static void LogMethod<T>(this T instance,string methodName) =>
  3.             Debug.Log($"{typeof(T).Name.ToHexColor("39c8b0")}.{methodName.ToHexColor("ffc66d")}", instance as Object);
  4.  
  5. public static string ToHexColor(this string value, string hexColor) =>
  6.             $"<b><color=#{hexColor}>{value}</color></b>";
  7.  
  8. // Rider Live Template Shortcut : `mlog`
  9. this.LogMethod(nameof($MethodName$));
Add Comment
Please, Sign In to add comment