浏览代码
Merge pull request #727 from Unity-Technologies/Branch_SkyLightingOverride
Merge pull request #727 from Unity-Technologies/Branch_SkyLightingOverride
List of available skies is now generated from reflection information./feature-ReflectionProbeFit
GitHub
7 年前
当前提交
5426acfa
共有 8 个文件被更改,包括 150 次插入 和 47 次删除
-
13ScriptableRenderPipeline/Core/CoreRP/Editor/Volume/VolumeComponentEditor.cs
-
2ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDRenderPipelineMenuItems.cs
-
2ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/HDRISky/HDRISky.cs
-
2ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/ProceduralSky/ProceduralSky.cs
-
65ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/SkyManager.cs
-
22ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/SkySettings.cs
-
26ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/VisualEnvironment.cs
-
65ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Sky/VisualEnvironmentEditor.cs
|
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
using UnityEditor; |
|||
using UnityEngine.Experimental.Rendering.HDPipeline; |
|||
using UnityEditor.Experimental.Rendering; |
|||
|
|||
namespace UnityEditor.Experimental.Rendering.HDPipeline |
|||
{ |
|||
[VolumeComponentEditor(typeof(VisualEnvironment))] |
|||
public class VisualEnvironmentEditor : VolumeComponentEditor |
|||
{ |
|||
SerializedDataParameter m_SkyType; |
|||
SerializedDataParameter m_FogType; |
|||
|
|||
List<GUIContent> m_SkyClassNames = null; |
|||
List<int> m_SkyUniqueIDs = null; |
|||
|
|||
public override void OnEnable() |
|||
{ |
|||
base.OnEnable(); |
|||
var o = new PropertyFetcher<VisualEnvironment>(serializedObject); |
|||
|
|||
m_SkyType = Unpack(o.Find(x => x.skyType)); |
|||
m_FogType = Unpack(o.Find(x => x.fogType)); |
|||
} |
|||
|
|||
void UpdateSkyIntPopupData() |
|||
{ |
|||
if(m_SkyClassNames == null) |
|||
{ |
|||
m_SkyClassNames = new List<GUIContent>(); |
|||
m_SkyUniqueIDs = new List<int>(); |
|||
|
|||
// Add special "None" case.
|
|||
m_SkyClassNames.Add(new GUIContent("None")); |
|||
m_SkyUniqueIDs.Add(0); |
|||
|
|||
var skyTypesDict = SkyManager.skyTypesDict; |
|||
|
|||
foreach (KeyValuePair<int, Type> kvp in skyTypesDict) |
|||
{ |
|||
m_SkyClassNames.Add(new GUIContent(kvp.Value.Name.ToString())); |
|||
m_SkyUniqueIDs.Add(kvp.Key); |
|||
} |
|||
} |
|||
} |
|||
|
|||
public override void OnInspectorGUI() |
|||
{ |
|||
UpdateSkyIntPopupData(); |
|||
|
|||
using (new EditorGUILayout.HorizontalScope()) |
|||
{ |
|||
DrawOverrideCheckbox(m_SkyType); |
|||
using (new EditorGUI.DisabledScope(!m_SkyType.overrideState.boolValue)) |
|||
{ |
|||
EditorGUILayout.IntPopup(m_SkyType.value, m_SkyClassNames.ToArray(), m_SkyUniqueIDs.ToArray(), new GUIContent("Sky Type")); |
|||
} |
|||
} |
|||
PropertyField(m_FogType); |
|||
} |
|||
} |
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue