using System.Reflection; using XCEngine; using XCEngine.Rendering; using XCEngine.Rendering.Universal; namespace Gameplay { public sealed class ScriptableRenderContextApiSurfaceProbe : MonoBehaviour { public bool HasPublicContextRecordScene; public bool HasPublicContextRecordOpaqueScenePhase; public bool HasPublicContextRecordBeforeOpaqueInjection; public bool HasPublicContextRecordShaderVectorFullscreenPass; public bool HasPublicContextCameraData; public bool HasPublicContextLightingData; public bool HasPublicContextShadowData; public bool HasPublicContextEnvironmentData; public bool HasPublicContextFinalColorData; public bool HasPublicContextStageColorData; public bool HasPublicCameraRequestContextHasDirectionalShadow; public bool HasPublicCameraRequestContextClearDirectionalShadow; public bool HasPublicPipelineAssetConfigureCameraFramePlan; public bool HasPlanningContextType; public bool HasRendererFeatureConfigureCameraFramePlan; public bool HasRendererRecordingContextType; public bool HasRendererCameraRequestContextType; public void Start() { const BindingFlags PublicInstanceMethodFlags = BindingFlags.Instance | BindingFlags.Public; System.Type contextType = typeof(ScriptableRenderContext); System.Type cameraRequestContextType = typeof(ScriptableRenderPipelineCameraRequestContext); System.Type pipelineAssetType = typeof(ScriptableRenderPipelineAsset); System.Type rendererFeatureType = typeof(ScriptableRendererFeature); HasPublicContextRecordScene = contextType.GetMethod( "RecordScene", PublicInstanceMethodFlags) != null; HasPublicContextRecordOpaqueScenePhase = contextType.GetMethod( "RecordOpaqueScenePhase", PublicInstanceMethodFlags) != null; HasPublicContextRecordBeforeOpaqueInjection = contextType.GetMethod( "RecordBeforeOpaqueInjection", PublicInstanceMethodFlags) != null; HasPublicContextRecordShaderVectorFullscreenPass = contextType.GetMethod( "RecordShaderVectorFullscreenPass", PublicInstanceMethodFlags) != null; HasPublicContextCameraData = contextType.GetProperty( "cameraData", PublicInstanceMethodFlags) != null; HasPublicContextLightingData = contextType.GetProperty( "lightingData", PublicInstanceMethodFlags) != null; HasPublicContextShadowData = contextType.GetProperty( "shadowData", PublicInstanceMethodFlags) != null; HasPublicContextEnvironmentData = contextType.GetProperty( "environmentData", PublicInstanceMethodFlags) != null; HasPublicContextFinalColorData = contextType.GetProperty( "finalColorData", PublicInstanceMethodFlags) != null; HasPublicContextStageColorData = contextType.GetProperty( "stageColorData", PublicInstanceMethodFlags) != null; HasPublicCameraRequestContextHasDirectionalShadow = cameraRequestContextType.GetProperty( "hasDirectionalShadow", PublicInstanceMethodFlags) != null; HasPublicCameraRequestContextClearDirectionalShadow = cameraRequestContextType.GetMethod( "ClearDirectionalShadow", PublicInstanceMethodFlags) != null; HasPublicPipelineAssetConfigureCameraFramePlan = pipelineAssetType.GetMethod( "ConfigureCameraFramePlan", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) != null; HasPlanningContextType = contextType.Assembly.GetType( "XCEngine.Rendering.ScriptableRenderPipelinePlanningContext") != null; HasRendererFeatureConfigureCameraFramePlan = rendererFeatureType.GetMethod( "ConfigureCameraFramePlan", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) != null; HasRendererRecordingContextType = System.Type.GetType( "XCEngine.Rendering.Universal.RendererRecordingContext, XCEngine.RenderPipelines.Universal") != null; HasRendererCameraRequestContextType = System.Type.GetType( "XCEngine.Rendering.Universal.RendererCameraRequestContext, XCEngine.RenderPipelines.Universal") != null; } } }