浏览代码

[ReflectionProbeEditor] Refactoring

/feature-ReflectionProbeFit
Frédéric Vauchelles 7 年前
当前提交
9c8304d4
共有 2 个文件被更改,包括 22 次插入12 次删除
  1. 19
      ScriptableRenderPipeline/HDRenderPipeline/Editor/Lighting/HDReflectionProbeEditor.ProbeUtility.cs
  2. 15
      ScriptableRenderPipeline/HDRenderPipeline/Editor/Lighting/HDReflectionProbeEditor.cs

19
ScriptableRenderPipeline/HDRenderPipeline/Editor/Lighting/HDReflectionProbeEditor.ProbeUtility.cs


static Mesh s_SphereMesh;
static int _Cubemap = Shader.PropertyToID("_Cubemap");
void ChangeVisibilityOfAllTargets(bool visibility)
{
for (var i = 0; i < targets.Length; ++i)
{
var p = (ReflectionProbe)targets[i];
ChangeVisibility(p, visibility);
}
}
void InitializeAllTargetProbes()
{
for (var i = 0; i < targets.Length; ++i)
{
var p = (ReflectionProbe)targets[i];
var a = (HDAdditionalReflectionData)m_AdditionalDataSerializedObject.targetObjects[i];
InitializeProbe(p, a);
}
}
[InitializeOnLoadMethod]
static void Initialize()

15
ScriptableRenderPipeline/HDRenderPipeline/Editor/Lighting/HDReflectionProbeEditor.cs


s_ReflectionProbeEditors[p] = this;
}
for (var i = 0; i < targets.Length; ++i)
{
var p = (ReflectionProbe)targets[i];
var a = additionalData[i];
InitializeProbe(p, a);
ChangeVisibility(p, true);
}
InitializeAllTargetProbes();
ChangeVisibilityOfAllTargets(true);
for (var i = 0; i < targets.Length; ++i)
{
var p = (ReflectionProbe)targets[i];
ChangeVisibility(p, false);
}
ChangeVisibilityOfAllTargets(false);
}
public override void OnInspectorGUI()

正在加载...
取消
保存