diff --git a/Assets/Scripts/Gameplay/Player.cs b/Assets/Scripts/Gameplay/Player.cs index faafba3..3640b29 100644 --- a/Assets/Scripts/Gameplay/Player.cs +++ b/Assets/Scripts/Gameplay/Player.cs @@ -10,29 +10,30 @@ public class Player : MonoBehaviour [Header("Оружие")] public List weaponsContainer; + private int weaponIndex = 0; + public Weapon ActiveWeapon => weaponsContainer[weaponIndex]; [Header("Настройки погружения")] [SerializeField] private Transform UpPoint; [SerializeField] private Transform DownPoint; [SerializeField] private float MaxSpeed = 5f; [SerializeField] private float SmoothTime = 0.5f; // Время разгона/торможения - private float currentHeightVelocity = 0f; + private float totalHeight; public float DepthPercent => (UpPoint.position.y - transform.position.y) / totalHeight; - public float DepthPercentToStartPressure = 0.1f; - public float PressureMultiplier = 0.2f; + [Header("Давление")] + [SerializeField] private float DepthPercentToStartPressure = 0.1f; + [SerializeField] private float PressureMultiplier = 0.2f; public float PressurePercent { get; private set; } - public float RotationAngle { get; private set; } - private float totalHeight = 10f; - private int weaponIndex = 0; - public Weapon ActiveWeapon => weaponsContainer[weaponIndex]; + [Header("Здоровье")] + public Health HealthComponent; + [SerializeField] private List hitboxes; + [SerializeField] private float maxHp = 500; //вариант из настроек инициализировать - public Transform EnemiesTarget; - - public Health Health; - public List hitboxes; + [Header("Прицеливание врагов")] + [Tooltip("Точка в которую будут целиться враги")] public Transform EnemiesTarget; private void Awake() { @@ -40,7 +41,7 @@ public class Player : MonoBehaviour foreach (var hitbox in hitboxes) hitbox.Initialize(gameObject); - Health.Initialize(1000, hitboxes); + HealthComponent.Initialize(maxHp, hitboxes); } void Update() @@ -94,7 +95,7 @@ public class Player : MonoBehaviour ActiveWeapon.Shoot(); } - public void MoveToHeight(float targetHeight) + private void MoveToHeight(float targetHeight) { float currentY = transform.position.y; float newY = Mathf.SmoothDamp(