Quick bit of code to display the current method name (Switch “Debug.Log” for “Console.WriteLine” to use it without Unity)

System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace();
Debug.Log(st.GetFrame(0).GetMethod().Name);

 

 

Advertisements