浏览代码

Fixed gameobject leak on domain reload

/feature-ReflectionProbeBaking
Frédéric Vauchelles 7 年前
当前提交
c6f867db
共有 2 个文件被更改,包括 22 次插入4 次删除
  1. 13
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Reflection/PlanarReflectionProbeBaker.cs
  2. 13
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Reflection/ReflectionProbeBaker.cs

13
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Reflection/PlanarReflectionProbeBaker.cs


using UnityEngine.Rendering;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
using System.Linq;
namespace UnityEngine.Experimental.Rendering.HDPipeline.Internal
{

{
if (m_RenderCamera == null)
{
var go = GameObject.Find("__Probe Render Camera") ?? new GameObject("__Probe Render Camera");
GameObject go = null;
for (int i = 0, c = SceneManager.sceneCount; i < c; ++i)
{
go = SceneManager.GetSceneAt(i).GetRootGameObjects().FirstOrDefault(g => g.name == "__Probe Render Camera");
if (go != null)
break;
}
go = go ?? new GameObject("__Probe Render Camera");
go.hideFlags = HideFlags.HideAndDontSave;
m_RenderCamera = go.GetComponent<Camera>();

13
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Reflection/ReflectionProbeBaker.cs


using UnityEngine.Rendering;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
using System.Linq;
namespace UnityEngine.Experimental.Rendering.HDPipeline.Internal
{

{
if (m_RenderCamera == null)
{
var go = GameObject.Find("__Reflection Probe Render Camera") ?? new GameObject("__Reflection Probe Render Camera");
GameObject go = null;
for (int i = 0, c = SceneManager.sceneCount; i < c; ++i)
{
go = SceneManager.GetSceneAt(i).GetRootGameObjects().FirstOrDefault(g => g.name == "__Reflection Probe Render Camera");
if (go != null)
break;
}
go = go ?? new GameObject("__Reflection Probe Render Camera");
go.hideFlags = HideFlags.HideAndDontSave;
m_RenderCamera = go.GetComponent<Camera>();

正在加载...
取消
保存