浏览代码

Cleaned up sky editor setup for common settings.

/main
Julien Ignace 6 年前
当前提交
6e6f073b
共有 3 个文件被更改,包括 16 次插入13 次删除
  1. 8
      com.unity.render-pipelines.high-definition/HDRP/Editor/Sky/HDRISky/HDRISkyEditor.cs
  2. 7
      com.unity.render-pipelines.high-definition/HDRP/Editor/Sky/ProceduralSky/ProceduralSkyEditor.cs
  3. 14
      com.unity.render-pipelines.high-definition/HDRP/Editor/Sky/SkySettingsEditor.cs

8
com.unity.render-pipelines.high-definition/HDRP/Editor/Sky/HDRISky/HDRISkyEditor.cs


{
base.OnEnable();
// HDRI sky does not have control over sun display.
m_CommonUIElementsMask = 0xFFFFFFFF & ~(uint)(SkySettingsUIElement.IncludeSunInBaking);
var o = new PropertyFetcher<HDRISky>(serializedObject);
m_hdriSky = Unpack(o.Find(x => x.hdriSky));
}

PropertyField(m_hdriSky);
EditorGUILayout.Space();
uint uiElements = 0xFFFFFFFF;
uiElements &= ~(uint)(SkySettingsUIElement.IncludeSunInBaking);
base.CommonSkySettingsGUI(uiElements);
base.CommonSkySettingsGUI();
}
}
}

7
com.unity.render-pipelines.high-definition/HDRP/Editor/Sky/ProceduralSky/ProceduralSkyEditor.cs


{
base.OnEnable();
// Procedural sky orientation depends on the sun direction
m_CommonUIElementsMask = 0xFFFFFFFF & ~(uint)(SkySettingsUIElement.Rotation);
var o = new PropertyFetcher<ProceduralSky>(serializedObject);
m_SunSize = Unpack(o.Find(x => x.sunSize));

EditorGUILayout.Space();
uint uiElements = 0xFFFFFFFF;
uiElements &= ~(uint)(SkySettingsUIElement.Rotation);
base.CommonSkySettingsGUI(uiElements);
base.CommonSkySettingsGUI();
}
}
}

14
com.unity.render-pipelines.high-definition/HDRP/Editor/Sky/SkySettingsEditor.cs


SerializedDataParameter m_EnvUpdatePeriod;
SerializedDataParameter m_IncludeSunInBaking;
protected uint m_CommonUIElementsMask = 0xFFFFFFFF;
public override void OnEnable()
{
var o = new PropertyFetcher<SkySettings>(serializedObject);

}
protected void CommonSkySettingsGUI(uint uiElementMask = 0xFFFFFFFF)
protected void CommonSkySettingsGUI()
if ((uiElementMask & (uint)SkySettingsUIElement.Exposure) != 0)
if ((m_CommonUIElementsMask & (uint)SkySettingsUIElement.Exposure) != 0)
if ((uiElementMask & (uint)SkySettingsUIElement.Multiplier) != 0)
if ((m_CommonUIElementsMask & (uint)SkySettingsUIElement.Multiplier) != 0)
if ((uiElementMask & (uint)SkySettingsUIElement.Rotation) != 0)
if ((m_CommonUIElementsMask & (uint)SkySettingsUIElement.Rotation) != 0)
if ((uiElementMask & (uint)SkySettingsUIElement.UpdateMode) != 0)
if ((m_CommonUIElementsMask & (uint)SkySettingsUIElement.UpdateMode) != 0)
{
PropertyField(m_EnvUpdateMode);
if (!m_EnvUpdateMode.value.hasMultipleDifferentValues && m_EnvUpdateMode.value.intValue == (int)EnvironementUpdateMode.Realtime)

EditorGUI.indentLevel--;
}
}
if ((uiElementMask & (uint)SkySettingsUIElement.IncludeSunInBaking) != 0)
if ((m_CommonUIElementsMask & (uint)SkySettingsUIElement.IncludeSunInBaking) != 0)
PropertyField(m_IncludeSunInBaking);
}
}
正在加载...
取消
保存