Fix missing UICanvas linkage in prefab preview

#218
This commit is contained in:
Wojtek Figat
2021-03-17 11:12:08 +01:00
parent 4eeadf87fb
commit 8fb27e6f83
4 changed files with 35 additions and 0 deletions

View File

@@ -539,6 +539,16 @@ namespace FlaxEngine
Setup();
}
internal void ParentChanged()
{
#if FLAX_EDITOR
if (RenderMode == CanvasRenderMode.ScreenSpace && _editorRoot != null && _guiRoot != null)
{
_guiRoot.Parent = HasParent ? _editorRoot : null;
}
#endif
}
internal void OnEnable()
{
#if FLAX_EDITOR
@@ -587,6 +597,8 @@ namespace FlaxEngine
internal void EditorOverride(SceneRenderTask task, ContainerControl root)
{
if (_editorTask == task && _editorRoot == root)
return;
if (_editorTask != null && _renderer != null)
_editorTask.CustomPostFx.Remove(_renderer);
if (_editorRoot != null && _guiRoot != null)