mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-04-19 05:48:07 -04:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
29 lines
635 B
C#
29 lines
635 B
C#
namespace Editor.TerrainEditor;
|
|
|
|
[CustomEditor( typeof( Terrain ) )]
|
|
partial class TerrainComponentWidget : ComponentEditorWidget
|
|
{
|
|
public TerrainComponentWidget( SerializedObject obj ) : base( obj )
|
|
{
|
|
SetSizeMode( SizeMode.Default, SizeMode.Default );
|
|
|
|
Layout = Layout.Column();
|
|
BuildUI();
|
|
}
|
|
|
|
void BuildUI()
|
|
{
|
|
Layout.Clear( true );
|
|
|
|
// If there is no valid Storage on this Terrain - give create UI.
|
|
var storageProperty = SerializedObject.GetProperty( "Storage" );
|
|
if ( storageProperty is null || storageProperty.IsNull )
|
|
{
|
|
Layout.Add( CreateTerrain() );
|
|
return;
|
|
}
|
|
|
|
Layout.Add( SettingsPage() );
|
|
}
|
|
}
|