I am a complete beginner in unity and was going through unity documentation for clarification and understanding. I was looking for Monobehaviour class and saw all its variables, public functions , messages and Inherited Members.
I did not understood the concept of Inherited member i.e. what is inherited member
and how it is inherited…
so, plz can anyoone explain me in layman term.
thanks
An inherited member is one that was declared in a parent class. For example, if I have ClassA:
class ClassA {
public void DoSomething() { }
}
And ClassB inherits from that class:
class ClassB : ClassA
{
}
I can still use the DoSomething method in ClassB even though I didn’t declare it in ClassB. This is because the DoSomething function is inherited by ClassB.
ClassB b = new ClassB();
b.DoSomething();
So when the documentation says “inherited member” it means the property or method or whatever was declared in a parent class.
If you Google object oriented programming you should be able to find more information and learn about how classes work.