56 lines
1.3 KiB
C#
56 lines
1.3 KiB
C#
//using Editor;
|
|
//using Editor.Assets;
|
|
//using Sandbox;
|
|
//using VeloX;
|
|
//using static Editor.Inspectors.AssetInspector;
|
|
|
|
//[CanEdit( "asset:engstr" )]
|
|
//public class EngineStreamInspector : Widget, IAssetInspector
|
|
//{
|
|
// EngineStream EngineStream;
|
|
// ControlSheet MainSheet;
|
|
|
|
// public EngineStreamInspector( Widget parent ) : base( parent )
|
|
// {
|
|
// Layout = Layout.Column();
|
|
// Layout.Margin = 12;
|
|
// Layout.Spacing = 12;
|
|
|
|
// MainSheet = new ControlSheet();
|
|
|
|
// Layout.Add( MainSheet, 1 );
|
|
|
|
// }
|
|
|
|
// [EditorEvent.Hotload]
|
|
// void RebuildSheet()
|
|
// {
|
|
// if ( EngineStream is null || MainSheet is null )
|
|
// return;
|
|
|
|
// Layout.Clear( true );
|
|
// var text = Layout.Add( new Editor.TextEdit() );
|
|
// var but = Layout.Add( new Editor.Button( "Load JSON" ) );
|
|
// but.Clicked += () =>
|
|
// {
|
|
// EngineStream.LoadFromJson( text.PlainText );
|
|
// };
|
|
|
|
// var so = EngineStream.GetSerialized();
|
|
|
|
|
|
// so.OnPropertyChanged += _ =>
|
|
// {
|
|
// EngineStream.StateHasChanged();
|
|
// };
|
|
// Layout.Add( ControlWidget.Create( so.GetProperty( nameof( EngineStream.Layers ) ) ) );
|
|
// Layout.Add( ControlWidget.Create( so.GetProperty( nameof( EngineStream.Parameters ) ) ) );
|
|
// }
|
|
|
|
// public void SetAsset( Asset asset )
|
|
// {
|
|
// EngineStream = asset.LoadResource<EngineStream>();
|
|
// RebuildSheet();
|
|
// }
|
|
//}
|