I have a static class that I want to log some info to the console.
Its a static class so I can’t extend MonoBehavoir. I tried using Debug.Log() but it doesn’t recognise it.
Is there a certain using I need to include?
I’ve seen examples where no using has been included in their class and they could use Debug.Log()
system
February 22, 2012, 4:30am
3
Must be in a static class?
You could try:
public class TestDebug : MonoBehaviour
{
public static void ShowDebug(){
Debug.Log(“message”);
}
and you can use it by: TestDebug.ShowDebug();
If you spelled MonoBehaviour the same way in your script as you did in your question, then the error is that you need to fix your spelling. That’s all!
system
February 22, 2012, 3:00am
2
Debug is not static, so you can set up function for static function and class for unstatic function .