浏览代码

Merge pull request #1482 from Unity-Technologies/Fix-issue-with-Destroying-GameObjects-immediately-is-not-permitted-

Fix issue with 'Destroying GameObjects immediately is not permitted" …
/main
GitHub 6 年前
当前提交
59d2b07d
共有 1 个文件被更改,包括 10 次插入3 次删除
  1. 13
      com.unity.render-pipelines.core/CoreRP/Debugging/MousePositionDebug.cs

13
com.unity.render-pipelines.core/CoreRP/Debugging/MousePositionDebug.cs


public static void Cleanup()
{
if (s_Instance != null)
DestroyImmediate(s_Instance.gameObject);
{
// Either we call DestroyImmediate or Destroy we get an error :(
// GameViewEventCatcher is only use for SSR debugging currently so comment this code and uncomment it if you want to debug SSR
//DestroyImmediate(s_Instance.gameObject);
//Destroy(s_Instance.gameObject);
}
}
public static void Build()

#if UNITY_EDITOR
UnityEditor.SceneView.onSceneGUIDelegate -= OnSceneGUI;
UnityEditor.SceneView.onSceneGUIDelegate += OnSceneGUI;
GameViewEventCatcher.Build();
// Disabled as it cause error: GameViewEventCatcher is only use for SSR debugging currently so comment this code and uncomment it if you want to debug SSR
//GameViewEventCatcher.Build();
#endif
}

UnityEditor.SceneView.onSceneGUIDelegate -= OnSceneGUI;
GameViewEventCatcher.Cleanup();
// Disabled as it cause error: GameViewEventCatcher is only use for SSR debugging currently so comment this code and uncomment it if you want to debug SSR
//GameViewEventCatcher.Cleanup();
#endif
}

正在加载...
取消
保存