You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.7 KiB
49 lines
1.7 KiB
using UnityEditor.Rendering;
|
|
using UnityEngine.Rendering.HighDefinition;
|
|
|
|
namespace UnityEditor.Rendering.HighDefinition
|
|
{
|
|
[CanEditMultipleObjects]
|
|
[CustomEditor(typeof(ProceduralSky))]
|
|
class ProceduralSkySettingsEditor
|
|
: SkySettingsEditor
|
|
{
|
|
SerializedDataParameter m_SunSize;
|
|
SerializedDataParameter m_SunSizeConvergence;
|
|
SerializedDataParameter m_AtmosphericThickness;
|
|
SerializedDataParameter m_SkyTint;
|
|
SerializedDataParameter m_GroundColor;
|
|
SerializedDataParameter m_EnableSunDisk;
|
|
|
|
public override void OnEnable()
|
|
{
|
|
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));
|
|
m_SunSizeConvergence = Unpack(o.Find(x => x.sunSizeConvergence));
|
|
m_AtmosphericThickness = Unpack(o.Find(x => x.atmosphereThickness));
|
|
m_SkyTint = Unpack(o.Find(x => x.skyTint));
|
|
m_GroundColor = Unpack(o.Find(x => x.groundColor));
|
|
m_EnableSunDisk = Unpack(o.Find(x => x.enableSunDisk));
|
|
}
|
|
|
|
public override void OnInspectorGUI()
|
|
{
|
|
PropertyField(m_EnableSunDisk);
|
|
PropertyField(m_SunSize);
|
|
PropertyField(m_SunSizeConvergence);
|
|
PropertyField(m_AtmosphericThickness);
|
|
PropertyField(m_SkyTint);
|
|
PropertyField(m_GroundColor);
|
|
|
|
EditorGUILayout.Space();
|
|
|
|
base.CommonSkySettingsGUI();
|
|
}
|
|
}
|
|
}
|