Files
sbox-public/engine/Sandbox.Tools/ControlWidget/BBoxControlWidget.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

32 lines
716 B
C#

namespace Editor;
[CustomEditor( typeof( BBox ) )]
public class BBoxControlWidget : ControlWidget
{
SerializedObject obj;
public BBoxControlWidget( SerializedProperty property ) : base( property )
{
property.TryGetAsObject( out obj );
PaintBackground = false;
Layout = Layout.Column();
Layout.Spacing = 2;
var mins = Layout.Add( Create( obj.GetProperty( "Mins" ) ) );
var maxs = Layout.Add( Create( obj.GetProperty( "Maxs" ) ) );
var children = new List<Widget>();
children.AddRange( mins.Children );
children.AddRange( maxs.Children );
foreach ( var child in children )
{
if ( child is FloatControlWidget floatWidget )
{
floatWidget.MakeRanged( property );
}
}
}
}