浏览代码

Changed the way DebugUpdater is intantiated to make it more reliable

/main
Thomas 6 年前
当前提交
f2dca11e
共有 2 个文件被更改,包括 11 次插入8 次删除
  1. 8
      ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugManager.cs
  2. 11
      ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugUpdater.cs

8
ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugManager.cs


{
RegisterInputs();
RegisterActions();
var updater = UnityObject.FindObjectOfType<DebugUpdater>();
if (updater == null)
{
var go = new GameObject("[Debug Updater]") { hideFlags = HideFlags.HideInHierarchy };
go.AddComponent<DebugUpdater>();
}
}
public void Reset()

11
ScriptableRenderPipeline/Core/CoreRP/Debugging/DebugUpdater.cs


{
public class DebugUpdater : MonoBehaviour
{
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)]
static void RuntimeInit()
{
if (FindObjectOfType<DebugUpdater>() != null)
return;
var go = new GameObject { name = "[Debug Updater]" };
go.AddComponent<DebugUpdater>();
DontDestroyOnLoad(go);
}
void Update()
{
DebugManager.instance.UpdateActions();

正在加载...
取消
保存