Parent variable inheritance methods Unity3D/C#
Posted
by
Timothy Williams
on Game Development
See other posts from Game Development
or by Timothy Williams
Published on 2012-03-18T18:05:07Z
Indexed on
2012/03/18
18:23 UTC
Read the original article
Hit count: 339
c#
I'm creating a system where there is a base "Hero" class and each hero inherits from that with their own stats and abilities. What I'm wondering is, how could I call a variable from one of the child scripts in the parent script (something like maxMP = MP) or call a function in a parent class that is specified in each child class (in the parent update is alarms() in the child classes alarms() is specified to do something.)
Is this possible at all? Or not?
Thanks.
© Game Development or respective owner