public void RecalculateDynamics() { if (!GameUtils.IsPlayerValid(Player)) { return; } _screenPosition = GameUtils.WorldPointToScreenPoint(Player.Transform.position); if (Player.PlayerBones != null) { _headScreenPosition = GameUtils.WorldPointToScreenPoint(Player.PlayerBones.Head.position); } if ((Player.Profile != null) && (Player.Profile.Info != null)) { IsAI = (Player.Profile.Info.RegistrationDate <= 0); } IsOnScreen = GameUtils.IsScreenPointVisible(_screenPosition); Distance = Vector3.Distance(Main.Camera.transform.position, Player.Transform.position); IsVisible = RayCast.IsVisible(Player); TeamMate = IsInYourGroup(Player); Value = CalculateValue(Player); DistanceFromCenter = Vector2.Distance(Main.Camera.WorldToScreenPoint(Player.PlayerBones.Head.position), GameUtils.ScreenCenter); _playerColor = GetPlayerColor(Player); }