嵌套类访问

时间:2019-05-24 18:53:27

标签: c# inner-classes access-modifiers

在以下代码中难以访问“ SetAutomaticPlacement”方法。 我只是尝试将私有嵌套的Provider类公开,但是我得到了一个

可访问性不一致:基类... ”错误。

我需要对现有的类文件进行进一步的更改吗?

public class ARKitEnvironmentProbeSubsystem : XREnvironmentProbeSubsystem
    {
        protected override IProvider CreateProvider()
        {
            return new Provider();
        }

        class Provider : IProvider
        {
            public Provider()
            {
                // Construct the Objective-C environment probe provider.
                EnvironmentProbeApi.UnityARKit_EnvironmentProbeProvider_Construct();
            }

            public override void Start()
            {
                EnvironmentProbeApi.UnityARKit_EnvironmentProbeProvider_Start();
            }

            /// <summary>
            /// Stops the environment probe subsystem by disabling the environment probe state.
            /// </summary>
            public override void Stop()
            {
                // Disable the environment probe state.
                EnvironmentProbeApi.UnityARKit_EnvironmentProbeProvider_Stop();
            }

            /// <summary>
            /// Destroy the environment probe subsystem by first ensuring that the subsystem has been stopped and then
            /// destroying the provider.
            /// </summary>
            public override void Destroy()
            {
                EnvironmentProbeApi.UnityARKit_EnvironmentProbeProvider_Destruct();
            }

            /// <summary>
            /// Enable or disable automatic placement of environment probes by the provider.
            /// </summary>
            /// <param name='value'><c>true</c> if the provider should automatically place environment probes in the scene.
            /// Otherwise, <c>false</c></param>.
            public override void SetAutomaticPlacement(bool value)
            {
                EnvironmentProbeApi.UnityARKit_EnvironmentProbeProvider_SetAutomaticPlacementEnabled(value);
            }
//etc etc 

0 个答案:

没有答案