mirror of
https://github.com/celisej567/gm_construct_port.git
synced 2026-09-19 20:11:46 +03:00
Add files via upload
This commit is contained in:
21
code/ui/Health.cs
Normal file
21
code/ui/Health.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Sandbox;
|
||||
using Sandbox.UI;
|
||||
using Sandbox.UI.Construct;
|
||||
|
||||
public class Health : Panel
|
||||
{
|
||||
public Label Label;
|
||||
|
||||
public Health()
|
||||
{
|
||||
Label = Add.Label( "100", "value" );
|
||||
}
|
||||
|
||||
public override void Tick()
|
||||
{
|
||||
var player = Local.Pawn;
|
||||
if ( player == null ) return;
|
||||
|
||||
Label.Text = $"{player.Health.CeilToInt()}";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user