Files
sbox-public/engine/Sandbox.Engine/Scene/Components/Game/SpawnPoint.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

32 lines
770 B
C#

namespace Sandbox;
/// <summary>
/// Dictates where players will spawn when they join the game when using a NetworkHelper.
/// </summary>
[Expose]
[Title( "Spawn Point" )]
[Category( "Game" )]
[Icon( "accessibility_new" )]
[EditorHandle( "materials/gizmo/spawnpoint.png" )]
public sealed class SpawnPoint : Component
{
[Property] public Color Color { get; set; } = "#E3510D";
protected override void DrawGizmos()
{
base.DrawGizmos();
var spawnpointModel = Model.Load( "models/editor/spawnpoint.vmdl" );
Gizmo.Hitbox.Model( spawnpointModel );
Gizmo.Draw.Color = Color.WithAlpha( (Gizmo.IsHovered || Gizmo.IsSelected) ? 0.7f : 0.5f );
var so = Gizmo.Draw.Model( spawnpointModel );
if ( so is not null )
{
so.Flags.CastShadows = true;
}
}
}