您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
60 行
2.4 KiB
60 行
2.4 KiB
using System;
|
|
using UnityEditor.AnimatedValues;
|
|
using UnityEngine.Events;
|
|
using UnityEngine.Experimental.Rendering.HDPipeline;
|
|
using UnityEngine.Rendering;
|
|
|
|
namespace UnityEditor.Experimental.Rendering.HDPipeline
|
|
{
|
|
partial class PlanarReflectionProbeUI : BaseUI<SerializedPlanarReflectionProbe>
|
|
{
|
|
const int k_AnimBoolFields = 4;
|
|
static readonly int k_ReflectionProbeModeModeCount = Enum.GetValues(typeof(ReflectionProbeMode)).Length;
|
|
static readonly int k_AnimBoolTotal = k_AnimBoolFields + k_ReflectionProbeModeModeCount;
|
|
|
|
public InfluenceVolumeUI influenceVolume = new InfluenceVolumeUI();
|
|
public FrameSettingsUI frameSettings = new FrameSettingsUI();
|
|
public ProxyVolumeComponentUI proxyVolume = new ProxyVolumeComponentUI();
|
|
|
|
public AnimBool isSectionExpandedInfluenceSettings { get { return m_AnimBools[k_ReflectionProbeModeModeCount]; } }
|
|
public AnimBool isSectionExpandedCaptureSettings { get { return m_AnimBools[k_ReflectionProbeModeModeCount + 1]; } }
|
|
|
|
public AnimBool isSectionExpandedCaptureMirrorSettings { get { return m_AnimBools[k_ReflectionProbeModeModeCount + 2]; } }
|
|
public AnimBool isSectionExpandedCaptureStaticSettings { get { return m_AnimBools[k_ReflectionProbeModeModeCount + 3]; } }
|
|
|
|
public bool showCaptureHandles { get; set; }
|
|
|
|
public PlanarReflectionProbeUI()
|
|
: base(k_AnimBoolTotal)
|
|
{
|
|
|
|
}
|
|
|
|
public AnimBool IsSectionExpandedReflectionProbeMode(ReflectionProbeMode mode)
|
|
{
|
|
return m_AnimBools[(int)mode];
|
|
}
|
|
|
|
public override void Reset(SerializedPlanarReflectionProbe data, UnityAction repaint)
|
|
{
|
|
proxyVolume.Reset(data.proxyVolume, repaint);
|
|
frameSettings.Reset(data.frameSettings, repaint);
|
|
influenceVolume.Reset(data.influenceVolume, repaint);
|
|
base.Reset(data, repaint);
|
|
}
|
|
|
|
public override void Update()
|
|
{
|
|
for (var i = 0; i < k_ReflectionProbeModeModeCount; i++)
|
|
m_AnimBools[i].target = i == data.mode.intValue;
|
|
|
|
isSectionExpandedCaptureMirrorSettings.target = data.isMirrored;
|
|
isSectionExpandedCaptureStaticSettings.target = !data.isMirrored;
|
|
|
|
proxyVolume.Update();
|
|
frameSettings.Update();
|
|
influenceVolume.Update();
|
|
base.Update();
|
|
}
|
|
}
|
|
}
|