Why do we not use MonoBehavour for this lecture?

I am not sure whether this was mentioned in the video, but I don’t see why we can’t have the Node script inherit from MonoBehaviour?

Is there a good reason to make it a pure c# class? For performance or something?

There’s no need for a node to be a MonoBehaviour. We only need a class to inherit from MonoBehaviour if it is going to live on a game object in the hierarchy, and we need the Unity engine to know about them (for message callbacks, like Update, etc). The nodes don’t.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms