Merge branch 'Tryibion-scale-default'
This commit is contained in:
@@ -31,13 +31,26 @@ namespace FlaxEditor.SceneGraph.Actors
|
||||
|
||||
// Rotate to match the space (GUI uses upper left corner as a root)
|
||||
Actor.LocalOrientation = Quaternion.Euler(0, -180, -180);
|
||||
var uiControl = new UIControl
|
||||
bool canSpawn = true;
|
||||
foreach (var uiControl in Actor.GetChildren<UIControl>())
|
||||
{
|
||||
Name = "Canvas Scalar",
|
||||
Transform = Actor.Transform,
|
||||
Control = new CanvasScaler()
|
||||
};
|
||||
Root.Spawn(uiControl, Actor);
|
||||
if (uiControl.Get<CanvasScaler>() == null)
|
||||
continue;
|
||||
canSpawn = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (canSpawn)
|
||||
{
|
||||
var uiControl = new UIControl
|
||||
{
|
||||
Name = "Canvas Scalar",
|
||||
Transform = Actor.Transform,
|
||||
Control = new CanvasScaler()
|
||||
};
|
||||
Root.Spawn(uiControl, Actor);
|
||||
}
|
||||
_treeNode.Expand();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -98,8 +98,8 @@ namespace FlaxEngine.GUI
|
||||
private float _scale = 1.0f;
|
||||
private float _scaleFactor = 1.0f;
|
||||
private float _physicalUnitSize = 1.0f;
|
||||
private Float2 _resolutionMin = new Float2(1, 1);
|
||||
private Float2 _resolutionMax = new Float2(10000, 10000);
|
||||
private Float2 _resolutionMin = new Float2(640, 480);
|
||||
private Float2 _resolutionMax = new Float2(7680, 4320);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current UI scale. Computed based on the setup when performing layout.
|
||||
|
||||
Reference in New Issue
Block a user