Fixinprocess

This commit is contained in:
ThomasCharester committed 2026-11-02 01:46:10 +03:00
1 parent 0619ada74f
commit 921c4125b7
772 files changed
+154236 -144405

No files matched your search

@@ -11,7 +11,6 @@ namespace Code.OfficeGame.BattleMode.HitBoxes
private LayerMask _hitBoxLayerMask;
private readonly Collider[] _hitResults = new Collider[8];
private readonly HashSet<GameObject> _alreadyHitTargets = new();
private void Awake()
{
@@ -27,7 +26,6 @@ namespace Code.OfficeGame.BattleMode.HitBoxes
BoxCollider box = bodyParts[hitBoxPartType];
Transform boxTransform = box.transform;
// Вычисляем точный мировой центр и размер коллайдера на кости в текущем кадре анимации
Vector3 worldCenter = boxTransform.TransformPoint(box.center);
Vector3 worldHalfExtents = Vector3.Scale(box.size * 0.5f, boxTransform.lossyScale);
@@ -43,14 +41,11 @@ namespace Code.OfficeGame.BattleMode.HitBoxes
{
Collider hitCol = _hitResults[i];
// Игнорируем самого себя
Debug.Log($"Попадание по {hitCol.name}");
if (hitCol.transform.root == transform.root) continue;
// Если за этот взмах мы ещё не били этого врага — засчитываем попадание!
if (_alreadyHitTargets.Add(hitCol.gameObject))
{
onNewTargetHit?.Invoke(hitCol);
}
onNewTargetHit?.Invoke(hitCol);
}
}
}