Version: 2023.2

ReflectionProbe.reflectionProbeChanged

切换到手册

描述

添加委托以在将反射探针添加到场景或将其从场景中删除时收到通知。

using UnityEngine;
using UnityEngine.Rendering;

public class ReflectionProbeManager : MonoBehaviour { private static void OnReflectionProbeEvent(ReflectionProbe probe, ReflectionProbe.ReflectionProbeEvent eventType) { Debug.Log("A ReflectionProbe event has occured: " + eventType); }

void Start() { ReflectionProbe.reflectionProbeChanged += OnReflectionProbeEvent; }

void OnDestroy() { ReflectionProbe.reflectionProbeChanged -= OnReflectionProbeEvent; } }