Guest User

Unity Debug Class - extend it!

a guest
Mar 8th, 2021
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 KB | None | 0 0
  1. // how to "extend" Debug class in Unity
  2. // @kurtdekker
  3.  
  4. static class Debug
  5. {
  6.     // gotta mirror all the other ones!
  7.     public static void Log( string s)
  8.     {
  9.         UnityEngine.Debug.Log( s);
  10.     }
  11.  
  12.     public static void LogWarning( string s)
  13.     {
  14.         UnityEngine.Debug.LogWarning( s);
  15.     }
  16.  
  17.     public static void LogError( string s)
  18.     {
  19.         UnityEngine.Debug.LogError( s);
  20.     }
  21.  
  22.     // @kurtdekker
  23.  
  24.     public static void Log( string s, UnityEngine.Object o)
  25.     {
  26.         UnityEngine.Debug.Log( s, o);
  27.     }
  28.  
  29.     public static void LogWarning( string s, UnityEngine.Object o)
  30.     {
  31.         UnityEngine.Debug.LogWarning( s, o);
  32.     }
  33.  
  34.     public static void LogError( string s, UnityEngine.Object o)
  35.     {
  36.         UnityEngine.Debug.LogError( s, o);
  37.     }
  38.  
  39.     public static void LogError( object o)
  40.     {
  41.         UnityEngine.Debug.LogError( o.ToString());
  42.     }
  43.  
  44.     public static void Break()
  45.     {
  46.         UnityEngine.Debug.Break();
  47.     }
  48.     // gotta keep mirroring more; that's as a typing exercise for you!!
  49.  
  50.     // @kurtdekker
  51.  
  52.     public static void KurtLog( string s)
  53.     {
  54.         UnityEngine.Debug.Log( "KurtLog:" + s);
  55.     }
  56. }
  57.  
  58.  
Advertisement
Add Comment
Please, Sign In to add comment