Skip to main content
Inspiring
September 17, 2016

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




    This topic has been closed for replies.

    2 replies

    Inspiring
    September 17, 2016
    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.
    pjennessAuthor
    Inspiring
    September 17, 2016
    oh right.  that simple :)  

    Thanks!!

    -P
    Drift VFX Visual, Virtual , Vertical Want 970GTX on Macbook for good FPS? https://forums.oculus.com/viewtopic.php?f=26&t=17349