Editor preview component for a pillar architecture piece. It implements IArchPreview, sets Kind to Pillar, and in Draw it casts the payload to ArchPillarPart then draws colored sphere gizmos at positions returned by ArchPillarGen.Positions, adjusting color based on selection and lifting by context.Lift.
namespace Sunless.Architecture;
public sealed class ArchPillarPreview : IArchPreview
{
public ArchKind Kind => ArchKind.Pillar;
public void Draw( ArchPreviewContext context )
{
if ( context.Payload is not ArchPillarPart pillar )
{
return;
}
Gizmo.Draw.Color = context.Selected ? Color.Yellow : Color.Green.WithAlpha( 0.5f );
foreach ( var position in ArchPillarGen.Positions( pillar ) )
{
Gizmo.Draw.LineSphere( position + Vector3.Up * context.Lift, 8f );
}
}
}