Version: 2021.2
Experimental: this API is experimental and might be changed or removed in the future.

IScriptableRuntimeReflectionSystem

interface in UnityEngine.Experimental.Rendering

切换到手册

描述

定义运行时反射系统所需的成员。

您可以将空实现用作基类,请参阅 ScriptableRuntimeReflectionSystem

using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.Rendering;

abstract class CustomRuntimeReflectionSystem : IScriptableRuntimeReflectionSystem { List<ReflectionProbe> m_RealtimeReflectionProbes = new List<ReflectionProbe>(); List<RenderTexture> m_RealtimeReflectionProbeTargets = new List<RenderTexture>();

public bool TickRealtimeProbes() { for (int i = 0, c = m_RealtimeReflectionProbes.Count; i < c; ++i) { var probe = m_RealtimeReflectionProbes[i]; var target = m_RealtimeReflectionProbeTargets[i];

RenderProbe(probe, target);

probe.realtimeTexture = target; }

return true; }

protected abstract void RenderProbe(ReflectionProbe probe, RenderTexture target); public abstract void Dispose(); }

公共函数

TickRealtimeProbes更新反射探针。