Version: 2020.1

ReflectionProbe.defaultReflectionSet

切换到手册

描述

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

另请参阅:ReflectionProbe

using UnityEngine;
using UnityEngine.Rendering;

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

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

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