Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
pjenness's avatar
pjenness
Rising Star
10 years ago

Inheriting the OVEPLayercontroller

Hiya

In my app I'm inheriting from the OVR player controller to use most of its functionality, however I change a little and need to access some of the attributes.

Im wondering is there a way to access the Protected attributes without changing the file, as I have been making them public so they become accessible.

If I dont I get:

Assets/DriftVFX/Scripts/DriftOVRPlayerController.cs(217,25): error CS0122: `OVRPlayerController.MoveThrottle' is inaccessible due to its protection level
Assets/DriftVFX/Scripts/DriftOVRPlayerController.cs(205,69): error CS0122: `OVRPlayerController.InitialPose' is inaccessible due to its protection level

etc

Do I have to re-expose/override them in my DriftOVRPlayerController class ?

I'd prefer not to have to update the ovrPlayerController each time it gets updated.

ANy ideas?

Cheers

-P




2 Replies

Replies have been turned off for this discussion
  • Yes, when deriving from a class, you need to reexpose any fields you want to make public. You don't need to change the base class, just add public properties that get and set the protected fields you are interested in.