Spawn canvas scalar on canvas creation.

This commit is contained in:
Chandler Cox
2023-10-27 13:25:50 -05:00
parent 70a06c5db3
commit 90642b8862

View File

@@ -7,6 +7,7 @@ using Real = System.Single;
#endif
using FlaxEngine;
using FlaxEngine.GUI;
namespace FlaxEditor.SceneGraph.Actors
{
@@ -30,6 +31,12 @@ 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
{
Name = "Canvas Scalar",
Control = new CanvasScaler()
};
Root.Spawn(uiControl, Actor);
}
/// <inheritdoc />