浏览代码

Remove old probe acquisition

/main
RSlysz 6 年前
当前提交
18425484
共有 2 个文件被更改,包括 4 次插入30 次删除
  1. 5
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Handles.cs
  2. 29
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.cs

5
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Handles.cs


var p = m_SerializedHDProbe as SerializedHDReflectionProbe;
var o = this;
BakeRealtimeProbeIfPositionChanged(s, p, o);
if(EditMode.editMode == EditMode.SceneViewEditMode.ReflectionProbeOrigin)
{
Handle_OriginEditing(s, p, o);
}
}
static void Handle_OriginEditing(HDReflectionProbeUI s, SerializedHDReflectionProbe sp, Editor o)

29
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.cs


return editMode == EditMode.SceneViewEditMode.ReflectionProbeBox || editMode == EditMode.SceneViewEditMode.Collider || editMode == EditMode.SceneViewEditMode.GridBox ||
editMode == EditMode.SceneViewEditMode.ReflectionProbeOrigin;
}
void BakeRealtimeProbeIfPositionChanged(HDReflectionProbeUI s, SerializedHDReflectionProbe sp, Editor o)
{
if (Application.isPlaying
|| ((ReflectionProbeMode)sp.mode.intValue) != ReflectionProbeMode.Realtime)
{
m_PositionHash = 0;
return;
}
var hash = 0;
for (var i = 0; i < sp.serializedLegacyObject.targetObjects.Length; i++)
{
var p = (ReflectionProbe)sp.serializedLegacyObject.targetObjects[i];
var tr = p.GetComponent<Transform>();
hash ^= tr.position.GetHashCode();
}
if (hash != m_PositionHash)
{
m_PositionHash = hash;
for (var i = 0; i < sp.serializedLegacyObject.targetObjects.Length; i++)
{
var p = (ReflectionProbe)sp.serializedLegacyObject.targetObjects[i];
var check = p.RenderProbe();
Debug.Log(check);
}
}
}
}
}
正在加载...
取消
保存