You acces to ShooterUnit by the shootAction script?

Hello, in the turn based course, in the Action Camera, at 11:20 minutes you writte for me a mystery variable :slight_smile:
you write :

Unit shooterUnit = ShootAction.GetUnit();

But we have published it in the BaseAction script.
In the ShootAction Script we have declared the public method to get the TargetUnit.
I understand why we return targetUnit because we have created this variable in this same script (shootAction), but we declare GetUnit in the BaseAcion Script.
Is it because ShootAction is a BaseAction class script ?
we can access by it to the public method in BaseAction Script ?
I’m a little bit confused lol :wink:
Thanks for the explain (again :wink: )
François

Yes. ShootAction is a BaseAction. It inherits everything from BaseAction. So, anything that is not private in BaseAction is also available in ShootAction. Because they are the same thing.

BaseAction is the ‘car’ and ShootAction is the ‘Toyota’ :grin:

1 Like

Ok Clear, Again a new knowledge :wink:
Thanks Bixarrio.
Take Care
François

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms