Awake() & Start() in MonoBehaviourPunCallbacks

Options
I am following the PUN Basics tutorial and in Step 1, MonoBehaviourPunCallbacks replaced MonoBehaviour as the Parent class of Launcher.

I am curious how MonoBehaviourPunCallbacks has the method Awake() & Start() which belongs to MonoBehaviour class?

There is no error in the IDE when I expect it to have errors.

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Veneni,

    MonoBehaviourPunCallbacks extends MonoBehaviour.
    That's why it can have all MonoBehaviour messages methods.
    when you extend MonoBehaviourPunCallbacks, override OnEnable and OnDisable which are already implemented in the base class and you could implement other MonoBehaviour methods .
  • Veneni
    Options
    Ah thanks ! I cannot find this inheritance of MonoBehaviour in MonoBehaviourPunCallbacks documentation.