mirror of
https://github.com/Facepunch/sbox-public.git
synced 2025-12-28 17:08:18 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
32 lines
716 B
C#
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 );
|
|
}
|
|
}
|
|
}
|
|
}
|