using Sandbox;
public sealed class PositionRandomizer : Component
{
[Property]
public Vector3 Offset { get; set; }
protected override void OnEnabled()
{
base.OnEnabled();
LocalPosition += Game.Random.VectorInCube( 1 ) * Offset;
}
protected override void DrawGizmos()
{
base.DrawGizmos();
if ( !Gizmo.IsSelected ) return;
Gizmo.Transform = WorldTransform.WithRotation( Rotation.Identity );
Gizmo.Draw.LineBBox( new BBox( -Offset, Offset ) );
}
}