mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-02 11:28:19 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
32 lines
770 B
C#
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;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|