浏览代码

Update reflection cubemap inspector

/feature-ReflectionProbeFit
Frédéric Vauchelles 7 年前
当前提交
12379ae5
共有 3 个文件被更改,包括 74 次插入8 次删除
  1. 8
      ScriptableRenderPipeline/HDRenderPipeline/Editor/Lighting/HDReflectionProbeEditor.Drawers.cs
  2. 63
      ScriptableRenderPipeline/HDRenderPipeline/Editor/Lighting/HDReflectionProbeEditor.Preview.cs
  3. 11
      ScriptableRenderPipeline/HDRenderPipeline/Editor/Lighting/HDReflectionProbeEditor.Preview.cs.meta

8
ScriptableRenderPipeline/HDRenderPipeline/Editor/Lighting/HDReflectionProbeEditor.Drawers.cs


GUILayout.FlexibleSpace();
EditorGUILayout.EndHorizontal();
}
//static void OnBakeCustomButton(object data)
//{
// var mode = (int)data;
// var p = target as ReflectionProbe;
// if (mode == 0)
// BakeCustomReflectionProbe(p, false, true);
//}
#region Influence Volume
static void Drawer_InfluenceBoxSettings(UIState s, SerializedReflectionProbe p, Editor owner)

63
ScriptableRenderPipeline/HDRenderPipeline/Editor/Lighting/HDReflectionProbeEditor.Preview.cs


using UnityEngine;
namespace UnityEditor.Experimental.Rendering
{
partial class HDReflectionProbeEditor
{
HDCubemapInspector m_CubemapEditor;
public override bool HasPreviewGUI()
{
if (targets.Length > 1)
return false; // We only handle one preview for reflection probes
// Ensure valid cube map editor (if possible)
if (ValidPreviewSetup())
{
Editor editor = m_CubemapEditor;
CreateCachedEditor(((ReflectionProbe)target).texture, null, ref editor);
m_CubemapEditor = editor as HDCubemapInspector;
}
// If having one probe selected we always want preview (to prevent preview window from popping)
return true;
}
public override void OnPreviewSettings()
{
if (!ValidPreviewSetup()
|| m_CubemapEditor == null)
return;
m_CubemapEditor.OnPreviewSettings();
}
public override void OnPreviewGUI(Rect position, GUIStyle style)
{
if (!ValidPreviewSetup()
|| m_CubemapEditor == null)
{
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
Color prevColor = GUI.color;
GUI.color = new Color(1, 1, 1, 0.5f);
GUILayout.Label("Reflection Probe not baked yet");
GUI.color = prevColor;
GUILayout.FlexibleSpace();
GUILayout.EndHorizontal();
return;
}
var p = target as ReflectionProbe;
if (p != null && p.texture != null && targets.Length == 1)
m_CubemapEditor.DrawPreview(position);
}
bool ValidPreviewSetup()
{
var p = target as ReflectionProbe;
return p != null && p.texture != null;
}
}
}

11
ScriptableRenderPipeline/HDRenderPipeline/Editor/Lighting/HDReflectionProbeEditor.Preview.cs.meta


fileFormatVersion: 2
guid: 10da9cb15a7644245b87056613737840
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存