0
Q about Inheritance
Is it possible to inherent from a base class that's in another script, and if so, how do I declare any inherented member in the derived class.
2 Réponses
+ 2
@luka I assume he's using Unity.
@Dudamax
To inherit you use the syntax :
Ex/
class thisclassName : inherittedClass
So, : is the indication of the things this class will extend.
To access the base class directly use the 'base' keyword.
Although if you just want to access variable or methods in the base/derived class, you can just use the protected access modifier. To access the variable directly in the sub-classes.
0
2 individual c# scripts