the initial commit to the repo.
This commit is contained in:
parent
025c032b8c
commit
1b757591b9
264 changed files with 21882 additions and 0 deletions
45
EscapeFromTarkovCheat/Data/GameLootContainer.cs
Normal file
45
EscapeFromTarkovCheat/Data/GameLootContainer.cs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using EFT.Interactive;
|
||||
using EscapeFromTarkovCheat.Utils;
|
||||
using UnityEngine;
|
||||
|
||||
namespace EscapeFromTarkovCheat.Data
|
||||
{
|
||||
class GameLootContainer
|
||||
{
|
||||
public LootableContainer LootableContainer { get;}
|
||||
public Vector3 ScreenPosition => screenPosition;
|
||||
|
||||
public bool IsOnScreen { get; private set; }
|
||||
|
||||
public float Distance { get; private set; }
|
||||
|
||||
public string FormattedDistance => $"{Math.Round(Distance)}m";
|
||||
|
||||
private Vector3 screenPosition;
|
||||
|
||||
public GameLootContainer(LootableContainer lootableContainer)
|
||||
{
|
||||
if (lootableContainer == null)
|
||||
throw new ArgumentNullException(nameof(lootableContainer));
|
||||
|
||||
LootableContainer = lootableContainer;
|
||||
screenPosition = default;
|
||||
Distance = 0f;
|
||||
}
|
||||
|
||||
public void RecalculateDynamics()
|
||||
{
|
||||
if (!GameUtils.IsLootableContainerValid(LootableContainer))
|
||||
return;
|
||||
|
||||
screenPosition = GameUtils.WorldPointToScreenPoint(LootableContainer.transform.position);
|
||||
IsOnScreen = GameUtils.IsScreenPointVisible(screenPosition);
|
||||
Distance = Vector3.Distance(Main.MainCamera.transform.position, LootableContainer.transform.position);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue