Version: 2021.3

ReflectionProbe.defaultReflectionTexture

切换到手册

描述

添加委托以在默认镜面立方体贴图发生变化时收到通知。

另请参阅:ReflectionProbe

using UnityEngine;
using UnityEngine.Rendering;

public class ReflectionProbeManager : MonoBehaviour { private static void OnSetDefaultReflection(Texture cubemap) { Debug.Log("Default reflection cubemap was changed."); }

void Start() { ReflectionProbe.defaultReflectionTexture += OnSetDefaultReflection; }

void OnDestroy() { ReflectionProbe.defaultReflectionTexture -= OnSetDefaultReflection; } }