浏览代码

fix bool usage for headers

/main
RSlysz 6 年前
当前提交
c839184b
共有 5 个文件被更改,包括 34 次插入65 次删除
  1. 2
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDProbeUI.Skin.cs
  2. 41
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDProbeUI.cs
  3. 4
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeUI.Drawers.cs
  4. 43
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeUI.cs
  5. 9
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.cs

2
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDProbeUI.Skin.cs


const string proxySettingsHeader = "Projection Settings";
//influenceVolume have its own header
const string captureSettingsHeader = "Capture Settings";
protected const string captureSettingsHeader = "Capture Settings";
const string additionnalSettingsHeader = "Custom Settings";
static Dictionary<ToolBar, GUIContent> s_Toolbar_Contents = null;

41
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDProbeUI.cs


namespace UnityEditor.Experimental.Rendering.HDPipeline
{
partial class HDProbeUI : BaseUI<SerializedHDProbe>
abstract partial class HDProbeUI : BaseUI<SerializedHDProbe>
const int k_AnimBoolFields = 6;
static readonly int k_ReflectionProbeModeModeCount = Enum.GetValues(typeof(ReflectionProbeMode)).Length;
static readonly int k_AnimBoolTotal = k_AnimBoolFields + k_ReflectionProbeModeModeCount;
const int k_AnimBoolSingleFieldCount = 6;
static readonly int k_ReflectionProbeModeCount = Enum.GetValues(typeof(ReflectionProbeMode)).Length;
static readonly int k_ReflectionInfluenceShapeCount = Enum.GetValues(typeof(InfluenceShape)).Length;
static readonly int k_AnimBoolTotal = k_ReflectionProbeModeCount + k_AnimBoolSingleFieldCount + k_ReflectionInfluenceShapeCount;
public AnimBool isSectionExpandedInfluenceSettings { get { return m_AnimBools[k_ReflectionProbeModeModeCount]; } }
public AnimBool isSectionExpandedCaptureSettings { get { return m_AnimBools[k_ReflectionProbeModeModeCount + 1]; } }
public AnimBool isSectionExpandedInfluenceSettings { get { return m_AnimBools[k_ReflectionProbeModeCount]; } }
public AnimBool isSectionExpandedCaptureSettings { get { return m_AnimBools[k_ReflectionProbeModeCount + 1]; } }
public AnimBool isSectionExpandedCaptureMirrorSettings { get { return m_AnimBools[k_ReflectionProbeModeModeCount + 2]; } }
public AnimBool isSectionExpandedCaptureStaticSettings { get { return m_AnimBools[k_ReflectionProbeModeModeCount + 3]; } }
public AnimBool isSectionExpendedProxyVolume { get { return m_AnimBools[k_ReflectionProbeModeModeCount + 4]; } }
public AnimBool isSectionExpendedAdditionalSettings { get { return m_AnimBools[k_ReflectionProbeModeModeCount + 5]; } }
public AnimBool isSectionExpandedCaptureMirrorSettings { get { return m_AnimBools[k_ReflectionProbeModeCount + 2]; } }
public AnimBool isSectionExpandedCaptureStaticSettings { get { return m_AnimBools[k_ReflectionProbeModeCount + 3]; } }
public AnimBool isSectionExpendedProxyVolume { get { return m_AnimBools[k_ReflectionProbeModeCount + 4]; } }
public AnimBool isSectionExpendedAdditionalSettings { get { return m_AnimBools[k_ReflectionProbeModeCount + 5]; } }
public bool showCaptureHandles { get; set; }

return m_AnimBools[(int)mode];
}
public void SetModeTarget(int value)
{
for (var i = 0; i < k_ReflectionProbeModeCount; i++)
GetReflectionProbeModeBool(i).target = i == value;
}
AnimBool GetReflectionProbeModeBool(int i)
{
return m_AnimBools[i];
}
//reflectionProxyVolume.Reset(data.proxyVolumeComponent, repaint);
frameSettings.Reset(data.frameSettings, repaint);
influenceVolume.Reset(data.influenceVolume, repaint);
base.Reset(data, repaint);

{
for (var i = 0; i < k_ReflectionProbeModeModeCount; i++)
for (var i = 0; i < k_ReflectionProbeModeCount; i++)
//reflectionProxyVolume.Update();
SetModeTarget(data.mode.hasMultipleDifferentValues ? -1 : data.mode.intValue);
influenceVolume.SetIsSectionExpanded_Shape(data.influenceVolume.shape.hasMultipleDifferentValues ? -1 : data.influenceVolume.shape.intValue);
frameSettings.Update();
influenceVolume.Update();
base.Update();

4
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeUI.Drawers.cs


CED.space,
CED.Action(Drawer_ReflectionProbeMode),
CED.space,
CED.FadeGroup((s, p, o, i) => ((HDReflectionProbeEditor)o).m_UIState.IsSectionExpandedMode((ReflectionProbeMode)i),
CED.FadeGroup((s, p, o, i) => s.IsSectionExpandedReflectionProbeMode((ReflectionProbeMode)i),
FadeOption.Indent,
CED.noop, // Baked
CED.Action((s, d, o) => Drawer_ModeSettingsRealtime(s, d, o)), // Realtime

static readonly CED.IDrawer SectionCaptureSettings = CED.FoldoutGroup(
"Capture Settings",
captureSettingsHeader,
(s, p, o) => s.isSectionExpandedCaptureSettings,
FoldoutOption.Indent,
CED.Action(Drawer_CaptureSettings)

43
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeUI.cs


{
internal partial class HDReflectionProbeUI : HDProbeUI
{
const int k_AnimBoolSingleFieldCount = 4;
static readonly int k_ReflectionProbeModeCount = Enum.GetValues(typeof(ReflectionProbeMode)).Length;
static readonly int k_ReflectionInfluenceShapeCount = Enum.GetValues(typeof(InfluenceShape)).Length;
static readonly int k_AnimBoolsCount = k_ReflectionProbeModeCount + k_ReflectionInfluenceShapeCount + k_AnimBoolSingleFieldCount;
internal HDReflectionProbeUI()
{
toolBars = new[] { ToolBar.InfluenceShape | ToolBar.Blend | ToolBar.NormalBlend, ToolBar.CapturePosition };

public override void Update()
{
operations = 0;
SetModeTarget(data.mode.hasMultipleDifferentValues ? -1 : data.mode.intValue);
SetShapeTarget(data.influenceVolume.shape.hasMultipleDifferentValues ? -1 : data.influenceVolume.shape.intValue);
influenceVolume.Update();
public AnimBool IsSectionExpandedMode(ReflectionProbeMode mode)
{
return m_AnimBools[k_AnimBoolSingleFieldCount + (int)mode];
}
public void SetModeTarget(int value)
{
for (var i = 0; i < k_ReflectionProbeModeCount; i++)
GetReflectionProbeModeBool(i).target = i == value;
}
public AnimBool IsSectionExpandedShape(InfluenceShape value)
{
return m_AnimBools[k_AnimBoolSingleFieldCount + k_ReflectionProbeModeCount + (int)value];
}
public void SetShapeTarget(int value)
{
for (var i = 0; i < k_ReflectionInfluenceShapeCount; i++)
GetReflectionInfluenceShapeBool(i).target = i == value;
}
}
AnimBool GetReflectionProbeModeBool(int i)
{
return m_AnimBools[k_AnimBoolSingleFieldCount + i];
}
AnimBool GetReflectionInfluenceShapeBool(int i)
{
return m_AnimBools[k_AnimBoolSingleFieldCount + k_ReflectionProbeModeCount + i];
}
}
}

9
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.cs


boxInfluenceNormalHandle.faceColorsSelected = new Color[] { HDReflectionProbeEditor.k_GizmoThemeColorInfluenceNormalBlendFace };
}
public override void Update()
public void SetIsSectionExpanded_Shape(InfluenceShape shape)
base.Update();
SetIsSectionExpanded_Shape((InfluenceShape)data.shape.intValue);
SetIsSectionExpanded_Shape((int)shape);
void SetIsSectionExpanded_Shape(InfluenceShape shape)
public void SetIsSectionExpanded_Shape(int shape)
m_AnimBools[i].target = (int)shape == i;
m_AnimBools[i].target = shape == i;
}
public AnimBool IsSectionExpanded_Shape(InfluenceShape shapeType)

正在加载...
取消
保存