UI/PlayerHud/Components/PlayerInfo.razor
@namespace KOTH.UI
@inherits Panel
@attribute [StyleSheet]
@if (PlayerState.Local.PlayerPawn == null || !PlayerState.Local.PlayerPawn.IsValid())
{
return;
}
<root>
@if (GotLookAtInfo())
{
<label class="info">@(LookAtInfo.Description)@(LookAtInfo.Name) : @(LookAtInfo.Health)</label>
}
</root>
@code
{
FPlayerLookAtInfo LookAtInfo;
bool GotLookAtInfo()
{
bool ManInfront = PlayerUtils.LookAtInfoQuery(PlayerState.Local.PlayerPawn, Scene, out LookAtInfo);
return ManInfront && LookAtInfo.Team == PlayerState.Local.PlayerPawn.Team && !DamageManager.Instance.IgnoreTeams;
}
protected override int BuildHash()
{
return HashCode.Combine(Time.Now);
}
}