fix: update logic auto move HP.

This commit is contained in:
Tungdv
2025-10-30 19:41:39 +07:00
parent 94b6927422
commit 4be95aec7a
6 changed files with 33 additions and 26 deletions
+4 -2
View File
@@ -67,7 +67,7 @@ public class CECHostPlayer : CECPlayer
// ====== Ground cast config ======
[Header("Ground Cast")] [Tooltip("Khoảng thêm ngoài skinWidth để SphereCast xuống (m ngắn)")] [SerializeField]
private float extraGroundDistance = 0.05f;
private float extraGroundDistance = 1f;
[Tooltip("Bớt bán kính một chút để tránh tự va vào capsule (epsilon)")] [SerializeField]
private float radiusEpsilon = 0.005f;
@@ -281,7 +281,7 @@ public class CECHostPlayer : CECPlayer
_playerStateMachine.ChangeState(_idleState);
}
private bool GroundCheck(out RaycastHit hit)
public bool GroundCheck(out RaycastHit hit)
{
float radius = controller.radius;
float skin = controller.skinWidth;
@@ -927,6 +927,8 @@ public class CECHostPlayer : CECPlayer
m_aabbServer = m_aabb;
CalcPlayerAABB();
SetPos(pos);
m_CDRInfo.fStepHeight = 0.8f;
m_CDRInfo.vExtent = EC_Utility.ToVector3(m_aabbServer.Extents);
// Create work manager
m_pWorkMan = new CECHPWorkMan(this);
if (m_pWorkMan == null)