@@ -112,8 +112,9 @@ namespace FlaxEditor.Viewport.Previews
|
||||
LinkCanvas(_instance);
|
||||
|
||||
// Link UI control to the preview
|
||||
var uiControl = _instance as UIControl;
|
||||
if (_uiControlLinked == null &&
|
||||
_instance is UIControl uiControl &&
|
||||
uiControl != null &&
|
||||
uiControl.Control != null &&
|
||||
uiControl.Control.Parent == null)
|
||||
{
|
||||
@@ -128,6 +129,12 @@ namespace FlaxEditor.Viewport.Previews
|
||||
_uiControlLinked.Control.Parent = _uiParentLink;
|
||||
_hasUILinked = true;
|
||||
}
|
||||
|
||||
// Use UI mode when root is empty UI Control
|
||||
if (_uiControlLinked == null && uiControl != null && uiControl.Control == null)
|
||||
{
|
||||
_hasUILinked = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void LinkCanvas(Actor actor)
|
||||
|
||||
Reference in New Issue
Block a user