what does inherited member in unity documentation mean
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
Answer by Dave-Carlile · Sep 04, 2015 at 01:06 PM
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.
Thanks for the reply; But i have a question that
$$anonymous$$onobehaviour inherits from Behaviour class , then how come GetComponent can be inherited member of $$anonymous$$onobehavior class i.e. where does $$anonymous$$onobehavior inherits Component class. Also GetComponent is inherited $$anonymous$$ember of more than one class i.e. RigidBody, Renderer, $$anonymous$$onobehaviour etc. How??
Your answer
![](https://koobas.hobune.stream/wayback/20220612002554im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Is there better facebook sdk documentation? 0 Answers
Can someone explain the "Visual Effect"/ Project Settings to me? 0 Answers
Layout Group Changes in 5.5 ( Breaking Changes? ) Please explain! 0 Answers
How to add a new row to csv file every second 0 Answers
Unity Tools Documentation Redirection to Local Manual 1 Answer