Calling parent's awake,update,etc

Hello,

I've created two classes, class A and class B. Class B is inherited from class A:

public class A : MonoBehaviour {
    void Awake() {
        print("A::Awake");
    }
}

public class B : A {
    void Awake() {
        print("B:Awake");
    }
}

When I add a B class to a GameObject, only the print statement for B is called. I would like the Awake to be called for A as well. I read that you would normally pass the parent in through a constructor, but since we can't do that in Unity is there a different way?

Thank you, Justin

You'd use standard overriding, calling base.Awake from the child:

public classA:MonoBehaviour {
    protected virtual void Awake() {
        print("A::Awake");
    }
}

public classB:A {
    protected override void Awake() {
        print("B:Awake");
        base.Awake();
    }
}

You can't pass a reference to the parent like that link says - it'd be the same as "this".

The link you provided uses the word parent loosely, he's not talking about inheritance structuring