Files
XCEngine/managed/GameScripts/ScriptableRenderContextApiSurfaceProbe.cs

61 lines
2.6 KiB
C#

using System.Reflection;
using XCEngine;
using XCEngine.Rendering;
namespace Gameplay
{
public sealed class ScriptableRenderContextApiSurfaceProbe
: MonoBehaviour
{
public bool HasPublicContextRecordScene;
public bool HasPublicContextRecordOpaqueScenePhase;
public bool HasPublicContextRecordBeforeOpaqueInjection;
public bool HasPublicContextRecordShaderVectorFullscreenPass;
public bool HasPublicCameraRequestContextHasDirectionalShadow;
public bool HasPublicCameraRequestContextClearDirectionalShadow;
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);
HasPublicContextRecordScene =
contextType.GetMethod(
"RecordScene",
PublicInstanceMethodFlags) != null;
HasPublicContextRecordOpaqueScenePhase =
contextType.GetMethod(
"RecordOpaqueScenePhase",
PublicInstanceMethodFlags) != null;
HasPublicContextRecordBeforeOpaqueInjection =
contextType.GetMethod(
"RecordBeforeOpaqueInjection",
PublicInstanceMethodFlags) != null;
HasPublicContextRecordShaderVectorFullscreenPass =
contextType.GetMethod(
"RecordShaderVectorFullscreenPass",
PublicInstanceMethodFlags) != null;
HasPublicCameraRequestContextHasDirectionalShadow =
cameraRequestContextType.GetProperty(
"hasDirectionalShadow",
PublicInstanceMethodFlags) != null;
HasPublicCameraRequestContextClearDirectionalShadow =
cameraRequestContextType.GetMethod(
"ClearDirectionalShadow",
PublicInstanceMethodFlags) != null;
HasRendererRecordingContextType =
System.Type.GetType(
"XCEngine.Rendering.Renderer.RendererRecordingContext, XCEngine.RenderPipelines.Universal") != null;
HasRendererCameraRequestContextType =
System.Type.GetType(
"XCEngine.Rendering.Renderer.RendererCameraRequestContext, XCEngine.RenderPipelines.Universal") != null;
}
}
}